1 /* 2 * Program to the Messy Desk. In this program we are introducing the variables 3 * and determining the area of the objects to find the area that is not obscured. 4 */ 5 6 package shapes; 7 8 public class WorkArea { 9 public static void main(String[]args){ 10 // List of variables 11 double deskheight=24; 12 double deskwidth= 36; 13 double booklength= 11; 14 double bookwidth= 8.5; 15 double glassradius= 1.35; 16 double plateradius = 8; 17 18 // calculating the area of the objects. 19 SRectangle areaofdesk= new SRectangle(deskwidth, deskheight); 20 //System.out.println("areaofdesk="+ areaofdesk.area()); 21 22 // 2 books 23 SRectangle areaofbook= new SRectangle(booklength, bookwidth); 24 //System.out.println("areofbook="+areaofbook.area()); 25 26 //3 glasses 27 SCircle glass= new SCircle(glassradius); 28 SSquare areaofcoaster= glass.circumscribingSquare(); 29 //System.out.println("areaofcoaster="+ areaofcoaster.circumscribingCircle()); 30 31 //3 plates 32 SCircle areaofplate= new SCircle(plateradius); 33 //System.out.println("areaofplate="+areaofplate.area()); 34 35 // Area of the covered and uncovered area- 2 books, 3 coasters, 3 plates 36 double totalusedarea=(2*(areaofbook.area())+3*(areaofcoaster.area())+3*(areaofplate.area())); 37 //System.out.println("total covered area="+totalusedarea); 38 39 double areanotobscured= (areaofdesk.area()-totalusedarea); 40 System.out.println("total area not obscured=" + areanotobscured); 41 42 43 } 44 45 } 46 47