Homework #1 Introduction to Computing

Due: January 29, 2009 (Friday at 11:59 PM)

Paint Job Estimator Program

A painting company has determined that for every 115 square feet of wall space, one gallon of paint and eight hours of labor will be required. Additionally, for every 130 square feet of ceiling space, one gallon of paint and 6 hours of labor will be required. The company charges \$20.00 per hour for labor. Write a program that asks the user to enter the dimensions of the room (i.e., length, width, and ceiling height), the price of the wall paint per gallon, and the price of the ceiling paint per gallon. Your program should assume that the room is a box so you do not need to worry about window or door cutouts.

Since a homeowner might want to consider painting only the walls or ceiling, your program should display the information about the walls and ceiling separately. It should print:

• The number of gallons of wall paint required
• The hours of labor required for painting the walls
• The cost of the wall paint
• The labor charge for painting the walls
• The total cost of painting just the walls
• The number of gallons of ceiling paint required
• The hours of labor required for painting the ceiling
• The cost of the ceiling paint
• The labor charge for painting the ceiling
• The total cost of painting just the ceiling
• The total cost of painting both the walls and the ceiling

Before you start writing your program, (re)read section 3.3 on Designing a Program to Use Functions, because I want you to actually design your program. Split your program up into well-defined functions by doing a top-down design and developing a hierarchy chart.

When you write your program, be sure to use:

• meaningful variable names with good style (i.e., useCamelCase or use_underscores)
• comments at the start of the program and before each function describing what they do (see Program 3-3 on pp. 88-90)
• a main function (see Program 3-3 on pp. 88-90) located at the top of program with a call to it at the bottom to start execution
• global constants where appropriate with good style (ALL_CAPS_AND_UNDERSCORES). (Put your global constants after your initial comments describing the program and before your main function definition so they can be found and changed easily in future versions of your program.)

Submit your homework electronically at http://math-cs.cns.uni.edu/~schafer/submit/which_course.cgi

Submit the following files: