WorkArea.java
1    package shapes;
2    
3    import java.awt.*;
4    // Program used to display the area of the desk which is not obscured by any object and may still be used for studying
5    
6    public class WorkArea {
7    
8        public static void main(String[] args) {
9            double deskHeight = 24.0;
10           double deskWidth = 36.0;
11           double bookHeight = 11.0;
12           double bookWidth = 8.5;
13           double plateRadius = 8.0;
14           double glassRadius = 1.35;
15   
16           // Objects to think with
17           SRectangle desk = new SRectangle(deskHeight, deskWidth);
18   
19           SRectangle book = new SRectangle(bookHeight, bookWidth);
20   
21           SCircle plate = new SCircle(plateRadius);
22   
23           SCircle glass = new SCircle(glassRadius);
24   
25           SSquare coaster = glass.circumscribingSquare();
26   
27           double glassCoaster = glass.area();
28           double collectiveRadius = ((coaster.area() * 3) + (book.area() * 2) + (plate.area() * 3));
29           double deskArea = desk.area();
30           System.out.print("unobscured area of the desk = " + (deskArea-collectiveRadius));
31   
32       }
33   }
34   
35