WorkArea.java
1    /*A program to display the area of the desk 
2     
3     */
4    
5    
6    package shapes;
7    
8    public class WorkArea {
9        public static void main (String [] args){
10           SRectangle desk = new SRectangle (24,36);
11           SRectangle book = new SRectangle (8.5,11);
12           SCircle plate = new SCircle (8);
13           SCircle glass = new SCircle (1.35);
14           SSquare coaster = glass.circumscribingSquare();
15   
16   
17           System.out.println("area of desk = " + desk.area());
18   
19           System.out.println("area of 2 books = " + book.area()*2);
20   
21           System.out.println("area of 3 coasters = " + coaster.area()*3);
22   
23           System.out.println("area of 3 plates = " + plate.area()*3);
24   
25           System.out.println("area of the glass = " + glass.area()*3);
26   
27           System.out.println("Total area of the objects taking up space = " + (book.area()*2+coaster.area()*3+plate.area()*3));
28   
29           System.out.println("Area of the free space in the desk " + (desk.area()-(book.area()*2+coaster.area()*3+plate.area()*3)));
30   
31   
32   
33       }
34   }
35