/** Let's experiment with the Room class. * We'll create some rooms, and find how much it costs to tile/carpet them. */ public class Driver { public static void main(String [] args) { Room kitchen = new Room(10, 9, true); Room livingRoom = new Room (18, 16, false); double tileRate = 1.00; // $1 per square foot to tile double carpetRate = 0.50; // 0.50 per square foot to carpet System.out.printf("The kitchen will cost $ %.2f to tile.\n", kitchen.findTileCost(tileRate)); System.out.printf("The kitchen will cost $ %.2f to carpet.\n", kitchen.findCarpetCost(carpetRate)); System.out.printf("The living room will cost $ %.2f to tile.\n", livingRoom.findTileCost(tileRate)); System.out.printf("The living room will cost $ %.2f to carpet.\n", livingRoom.findCarpetCost(carpetRate)); // Now, let's make a house with 4 rooms. House h = new House(); h.add(new Room(12, 13, false)); h.add(new Room(15, 20, false)); h.add(new Room(8,10, true)); h.add(new Room(10, 13, true)); System.out.printf("House carpet cost = $ %.2f\n", h.findCarpetCost(carpetRate)); System.out.printf("House tile cost = $ %.2f\n", h.findTileCost(tileRate)); } }