CMSC 201 B & F Painting Company Out: Wednesday 2/17/99 |
The objective of this assignment is to get you started writing programs in C in the UNIX environment. This project will give you practice using loops, and mixing data types.
You have been hired as an entry-level programmer by the famous "B & F Painting Company". B & F specializes in selling only the highest quality "semi-gloss" paints. B & F paint sells for $19.95 per gallon. Each gallon of B & F's superior paint covers 50 square feet of wall space. If you do a good job, the owners of B & F have promised to paint your house free of charge!
Your assignment is to write a program for B & F that can be used with
B & F customers to calculate the amount and cost of paint for rooms of
various size. Your program will ask the user for the number of rooms
in his house. For each room, your program will ask the user for
the room dimensions
(in feet), calculate the wall space to be painted (in square feet),
and the number of gallons necessary to paint the wall,
and the cost of the paint for the room. Remember that the user cannot buy part of a
gallon of paint.
After the user has entered dimensions for all rooms,
your program will then display the total number of
gallons and the total cost for all rooms.
Be sure your program is robust and guards against invalid input. (I've never seen a house with less than 1 room, nor can I imagine a room with a negative dimension.)
You may assume that all rooms dimensions are an integral number of feet (no fractional feet or inches).
Althoug your output need not be identical to the above, all information (including the greeting) must be present.
Your C source code file for this project MUST be called proj1.c.
To submit your project, type the following at the Unix prompt:
submit cs201 proj1 proj1.c
To verify that your project was submitted, you can execute the following command at the Unix prompt. It will show all files that you submitted in a format similar to the Unix 'ls' command.
submitls cs201 proj1