1 2 3 4 5 6 7 //... shapes 8 9 10 11 package shapes; 12 13 public class Desk { 14 15 16 public static void main(String[] args) { 17 18 19 SRectangle desk = new SRectangle(24, 36); 20 21 System.out.println("desk = " + desk.toString()); 22 23 System.out.println("area of desk = " + desk.area()); 24 double AreaDesk = desk.area(); 25 26 //books 27 28 SRectangle book = new SRectangle(11, 8.5); 29 30 System.out.println("area of book1 = " + book.area()); 31 32 System.out.println("area of book2 = " + book.area()); 33 34 double AllBooks = (book.area() * 2); 35 //costers 36 37 SCircle glass = new SCircle(1.35); 38 39 40 SSquare coaster = glass.circumscribingSquare(); 41 42 43 System.out.println("area of coaster1 = " + coaster.area()); 44 45 System.out.println("area of coaster2 = " + coaster.area()); 46 47 System.out.println("area of coaster3 = " + coaster.area()); 48 49 double AllCoast = (coaster.area() * 3); 50 51 //plates 52 SCircle plate = new SCircle(8); 53 54 System.out.println("area of plate1 = " + plate.area()); 55 56 System.out.println("area of plate2 = " + plate.area()); 57 58 System.out.println("area of plate3 = " + plate.area()); 59 60 61 double AllPlates = (plate.area() * 3); 62 63 64 65 66 67 68 double Objects = (AllPlates) + (AllBooks) + (AllCoast); 69 70 System.out.println("area of objects = " + (Objects)); 71 72 73 74 75 double FreeDesk = (AreaDesk) - (Objects); 76 77 78 System.out.println("area of empty space = " + (FreeDesk)); 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 } 94 }