/* Driver.java -- contains main function for enhanced Painting program * In the long run, we like our main functions to be simple and concise * if possible. main() should delegate most of the work to the other * class files. */ import java.io.*; public class Driver { public static void main(String [] args) throws IOException { // Create 3 room objects -- illustrating use of different constructors. Room bedroom = new Room(12, 13, 8); Room kitchen = new Room(bedroom); Room office = new Room(); // Output the cost to print each room. // Note that it is not necessary to store the painting cost in a // variable -- here we call the getCost() at the time we are ready // to print. // Also notice that we have a trade-off between making the program more // concise, but at the same time packing a lot of code in each statement. System.out.println("Cost to paint the bedroom is $" + bedroom.getCost()); System.out.println("Cost to paint the kitchen is $" + kitchen.getCost()); System.out.println("Cost to paint the office is $" + office.getCost()); } }