Advertisement
mmayoub

RunMe.java

Jan 20th, 2023
961
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.25 KB | Software | 0 0
  1. package proj20012023;
  2.  
  3. public class RunMain {
  4.  
  5.     public static void main(String[] args) {
  6.         Circle c1;
  7.         Circle c2;
  8.            
  9.         c1 = new Circle();
  10.         c2 = new Circle(5, 9, 7);
  11.        
  12.         System.out.println("x = " + c1.getX());
  13.         System.out.println("y = " + c1.getY());
  14.         System.out.println("r = " + c1.getR());
  15.        
  16.         c1.setX(1);
  17.         c1.setY(2);
  18.         c1.setR(3);
  19.        
  20.         System.out.println("x = " + c1.getX());
  21.         System.out.println("y = " + c1.getY());
  22.         System.out.println("r = " + c1.getR());
  23.        
  24.         System.out.println(Math.max(c1.getR(), c2.getR()));
  25.        
  26.         System.out.println(" s = " + c1.getArea());
  27.         System.out.println(" s = " + c2.getArea());
  28.         c2.setArae(30);
  29.         System.out.println("r2 = " + c2.getR());
  30.         System.out.println(" s = " + c2.getArea());
  31.        
  32.         //c1.x=13;
  33.         //c1.y=-5.5;
  34.         //c1.r = -3;
  35.        
  36.         c1.setX(13);
  37.         c1.setY(-5.5);
  38.         c1.setR(-7);
  39.         System.out.println("r1 = " + c1.getR());
  40.        
  41.         System.out.println(c1);
  42.        
  43.         System.out.println("*********************************************************");
  44.        
  45.         Triangle t1,t2;
  46.         t1 = new Triangle(3,4,5);
  47.         t2 = new Triangle(7);
  48.         System.out.println("p = " + t2.getPerimeter());
  49.         t2.setC(5);
  50.         t2.setB(-5);
  51.        
  52.         System.out.println("p = " + t2.getPerimeter());
  53.         System.out.println(t2);
  54.     }
  55.  
  56. }
  57.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement