WorkArea.java
1    package shapes;
2    
3    import shapes.SRectangle;
4    import shapes.SCircle;
5    import shapes.SSquare;
6    import painter.SPainter;
7    
8    import java.awt.*;
9    
10   public class WorkArea {
11   
12       static Color BROWN = new Color(128, 90, 32);
13   
14       public static void main(String[] args) {
15   
16           Desk();
17       }
18   
19       private static void Desk() {
20   
21           // CODE THAT GIVES THE AREA OF THE DESK WITH NO ITEMS ON IT
22   
23           double deskDepth = 24.0;
24           double deskWidth = 36.0;
25   
26           SRectangle desk = new SRectangle(deskDepth, deskWidth);
27           double deskArea = desk.area();
28   
29           // CODE THAT GIVES THE AREA OF THE BOOKS
30   
31           double bookHeight = 8.5;
32           double bookWidth = 11.0;
33   
34           SRectangle books = new SRectangle(bookHeight, bookWidth);
35           double bookArea = books.area();
36           double bookArea2 = bookArea * 2;
37   
38           // CODE THAT GIVES THE AREA OF THE COASTERS
39   
40           double glassRadius = 1.35;
41   
42           SCircle glass = new SCircle(glassRadius);
43           SSquare coaster = glass.circumscribingSquare();
44           double coasterArea = coaster.area();
45           double coasterArea3 = coasterArea * 3;
46   
47           // CODE THAT GIVES THE AREA OF THE DINNER PLATES
48   
49           double dinnerPlateRadius = 8;
50   
51           SCircle dinnerPlate = new SCircle(dinnerPlateRadius);
52           double dinnerPlateArea = dinnerPlate.area();
53           double dinnerPlateArea3 = dinnerPlateArea * 3;
54           // CODE THAT GIVES THE AREA OF THE WORK SPACE ON THE DESK
55           double workSpaceArea = (((deskArea - bookArea2) - coasterArea3) - dinnerPlateArea3);
56           System.out.println("The area of the workspace on the desk is " + workSpaceArea);
57   
58   
59   
60   
61   
62       }
63   }
64