1 package shapes; 2 3 public class WorkSpace { 4 public static void main(String[] args){ 5 // CONSTRUCTING THE DESK 6 double deskHeight = 32; 7 double deskWidth = 60; 8 SRectangle desk = new SRectangle(deskHeight,deskWidth); 9 double deskArea = desk.area(); 10 11 // CONSTRUCTING NOTEBOOKS(2) 12 double noteBookHeight = 6; 13 double noteBookWidth = 9; 14 SRectangle noteBook = new SRectangle(noteBookHeight,noteBookWidth); 15 double noteBooksArea = (noteBook.area()*2); 16 17 // CONSTRUCTING LAB MANUAL 18 double labManualHeight = 10; 19 double labManualWidth = 13.5; 20 SRectangle labManual = new SRectangle(labManualHeight,labManualWidth); 21 double labManualArea = labManual.area(); 22 23 //CONSTRUCTING CANS(3) AND COASTERS(3) 24 double canDiameter= 2.6; 25 SCircle can = new SCircle(canDiameter/2.0); 26 SSquare whiteCoaster = can.circumscribingSquare(); 27 double whiteCoastersArea = (whiteCoaster.area()*3); 28 29 //CONSTRUCTING FOUR SMALLISH PLATES 30 double smallPlateDiameter = 6.5; 31 SCircle smallPlate = new SCircle(smallPlateDiameter/2); 32 double smallPlatesArea = (smallPlate.area()*4); 33 34 //CALCULATING THE COLLECTIVE AREA OF THE OBJECTS ON THE DESK 35 double collectiveArea = (noteBooksArea + labManualArea + whiteCoastersArea + smallPlatesArea); 36 37 //CALCULATING THE AREA WHICH IS NOT OBSCURED BY ANY OBJECT 38 double result = (deskArea-collectiveArea); 39 40 // DISPLAYING THE RESULT 41 System.out.println("The area of the desk which is not obscured by any object and may still be used for studying = " + result +" square inches"); 42 43 44 } 45 46 } 47