ITEC 120 LAB Back to Lab index page

Painting a Room

The file Paint.java contains a partial program, which when complete will calculate the amount of paint needed to paint the walls of a room of the given length and width. It assumes that the paint covers 350 square feet per gallon.

Save Paint.java to your directory and do the following:

Sample 1:

Program outputs: What is the width of the room to be painted?
User inputs: 13
Program outputs: What is the length of the room to be painted?
User inputs: 15
Program outputs: What is the height of the room to be painted?
User inputs: 8
Program outputs: The 13 x 15 x 8 room
will require 1.28 gallon(s) of paint.

Sample 2, after windows and doors added:

Program outputs: What is the width of the room to be painted?
User inputs: 13
Program outputs: What is the length of the room to be painted?
User inputs: 15
Program outputs: What is the height of the room to be painted?
User inputs: 8
Program outputs: How many doors are in the room?
User inputs: 1
Program outputs: How many windows are in the room?
User inputs: 2
Program outputs: The 13 x 15 x 8 room with 1 door and 2 windows
will require 1.1371428571428572 gallon(s) of paint.