UMBC CMSC104 | CSEE |
CMSC104Problem Solving and Computer Programming |
Develop an interactive program that will calculate the square feet of wall-to-wall carpet needed to carpet a house and the number of gallons necessary to paint the house. Additionally, you will calculate the cost of the paint and carpet. The ceilings are painted the same color, and all walls have a different color, for this program, we do not care what color. When calculating the amount of paint that is necessary, we will not be concerned with what happens to the windows and the walls. (We are not good painters.)
Calculations must be the result of the totals of each of the rooms in the house. Determine the amount of paint for the ceiling, walls, and the carpet and add that to the total needed for the house. You must write a separate function to determine each of these amounts. Use a function to get the length and width of each room, one room at a time.. Determine the cost for the carpet, ceiling paint, and wall paint, each in a separate function.
You must get the width and length of each room from the user. Perform the calculations and report the results, with a separate function. The format of the report is given in the example below.
You must do error checking on all inputs.
burt[146]: a.out Enter the height: 8 How many rooms are there in the house? 3 ******************** Room #1 **************** Enter the length: 10 Enter the width: 10 ******************** Room #2 **************** Enter the length: 15 Enter the width: 15 ******************** Room #3 **************** Enter the length: 18 Enter the width: 23 The carpet cost is $11254.97. The ceiling paint cost is $43.50. The wall paint cost is $87.00. burt[147]:
When submitting the assignment, I only want the file jdoe2p4.c. Please make the title and the file name the same when you submit it! If you submit a file named jdoe2p4.c, the way we save the material delete everything but the last file with than name. Therefore, your file will be lost and we will give you a zero!!!! Use your login ID!!!
Documentation | 25 points |
Correct Results | 25 points |
Correct Sytle | 25 points |
Other | 25 points |
You will lose 5 points if you do not name the file correctly.
You will lose 5 points if you email the project instead of submitting
it via Blackboard.
You will lose 5 points if the prompt is not on the next line.
/*****************************************************/ /* Program Header Block */ /* Filename: jdoe2p4.c */ /* Name: Ima Student */ /* Email: jdoe2@umbc.edu */ /* Date: 11 May 2006 */ /* Course/section: CMSC-104 */ /* Description: */ /* Analysis: */ /* Input: */ /* Output: */ /* Constraints: */ /* Formulas: */ /* Assumptions: */ /* Design: */ /* (Your psuedocode goes here.) */ /* */ /* Notes: (As needed.) */ /*****************************************************/
/*********************************************************** * Function name: function_name * * Description: (Your function psuedocode goes here) * * Input Parameters: Name and data type of each parameter. * * Return Value: Data type and description of what * * the return value is. * ***********************************************************/