WorkArea.java
1    /* 
2     * Program to  display the area of the messy desk which is not obscured by any object and 
3     *   still be used for studying 
4     */
5    
6    
7    package shapes;
8    import shapes.SRectangle;
9    import shapes.SCircle;
10   import shapes.SSquare;
11   public class WorkArea {
12       public static void main(String[] args) {
13   //finding the area of the desk
14           SRectangle desk = new SRectangle(24, 36);
15           System.out.println("desk = " + desk.toString());
16           System.out.println("Area of the desk = " + desk.area());
17   //finding the area of two books
18           SRectangle books = new SRectangle(8.5, 11);
19           System.out.println("book = " + desk.toString());
20           System.out.println("Area of the two books = " + 2 * books.area());
21   //finding the area of plate
22           SCircle plates = new SCircle(8);
23           System.out.println("plates = " + plates.toString());
24           System.out.println("Area of three plates = " + 3 * plates.area());
25   // finding the area of the glass
26           SCircle glass = new SCircle(1.35);
27           System.out.println("glass = " + glass.toString());
28           System.out.println("Area of three glasses = " + 3 * glass.area());
29   //finding the area of the coaster using the radius of glass
30           SSquare coaster = glass.circumscribingSquare();
31           System.out.println("coaster = " + coaster.toString());
32           System.out.println("area of three coasters = " + 3 * coaster.area());
33   //area of the object in the desk
34           double objects = ((2 * books.area() + 3 * plates.area()) + 3 * coaster.area());
35           System.out.println("Area occupied by the objects = " + objects);
36   //area of the disk not occupies
37           double result = (desk.area() - objects);
38           System.out.println("The area not occupied in the desk = " + result);
39   
40   
41       }
42   }
43   
44   
45