Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class obwodyipola {
- int boka;
- int bokb;
- void wezboki(int a, int b){
- boka=a;
- bokb=b;
- }
- int liczobwod(){
- int y=2*boka+2*bokb;
- return y;
- }
- int liczpole() {
- int z=boka*bokb;
- return z;
- }
- void piszopole(){
- System.out.println("pole: "+ liczpole());
- }
- void piszobwod () {
- System.out.println("obwód: "+ liczobwod());
- }
- }
- // main
- public class obwodyipolamain {
- public static void main (String[] args){
- obwodyipola prost= new obwodyipola();
- prost.boka=5;
- prost.bokb=3;
- prost.piszopole();
- prost.piszobwod();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement