Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. public class obwodyipola {
  2.     int boka;
  3.     int bokb;
  4.    
  5.     void wezboki(int a, int b){
  6.         boka=a;
  7.         bokb=b;
  8.     }  
  9.    
  10.     int liczobwod(){
  11.     int y=2*boka+2*bokb;
  12.     return y;
  13. }
  14.     int liczpole() {
  15.     int z=boka*bokb;
  16.     return z;
  17.     }
  18.  
  19.     void piszopole(){
  20.         System.out.println("pole: "+ liczpole());
  21.     }
  22.     void piszobwod () {
  23.         System.out.println("obwód:  "+ liczobwod());
  24.     }
  25. }
  26.  
  27. // main
  28.  
  29. public class obwodyipolamain {
  30.     public static void main (String[] args){
  31.         obwodyipola prost= new obwodyipola();
  32.         prost.boka=5;
  33.         prost.bokb=3;
  34.        
  35.         prost.piszopole();
  36.         prost.piszobwod();
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement