/* * A program that measures the area of a desk and objects that cover it */ package shapes; import shapes.SSquare; import shapes.SRectangle; import shapes.SCircle; public class WorkArea { public static void main(String[] args) { SRectangle desk = new SRectangle(24, 36); SRectangle book = new SRectangle(8.5, 11); SCircle glass = new SCircle(1.35); SSquare coster = glass.circumscribingSquare(); SCircle plate = new SCircle(8); double usedSpace = book.area() * 2 + coster.area() * 3 + plate.area() * 3; System.out.println("Collective area of objects on desk = " + usedSpace); double deskArea = desk.area(); System.out.println("Total Desk Area = " + deskArea); double freeDeskSpace = deskArea - usedSpace; System.out.println("Free Desk Space = " + freeDeskSpace); } }