Hi, I need help programming this code with these specific requirements, ive done a part of it already:
Design a C++ program to estimate the cost for painting a room. The user must supply all the necessary information for the room to be painted. The output must list the areas to be painted and the estimated cost for each area and the overall total for the room. The program should allow the user to redo the process with different specifications (either the same room or a different room). It is not necessary to combine the outputs from multiple rooms to a single total.
The ceiling in any room may be white or a color, the walls a light shade of color, and the door and window moldings and baseboards will be either white or a color that is complementary to the color of the walls.
Prompt the user for and read the following:
Length, width and height of the room in feet and inches (you may assume the room is a simple rectangle).
Ceiling paint either white or colored.
The number and size of the windows in inches (a “for” loop is recommended).
The number and size of the doorways in inches (a “while” or “do-while” loop is recommended).
Window and door trim as white or color (note that all trim will be the same).
You will need to convert all the dimensions to either inches or feet for calculations. Store window and door dimensions and areas in separate arrays or, optionally, in a two-dimensional array. Note that window trim covers all four (4) sides of a window, door trim covers only three (3) sides. All calculated fields must be float or double.
Paint for the ceiling and walls will cost $12.50 per gallon; the baseboards and molding will be semi-gloss enamel at $6.50 per quart for white and $8.50 per quart for colors. Coverage rates are approximately 250 square feet per gallon of ceiling and wall paint and 100 square feet per quart of enamel.
After accepting the required inputs, clear the screen and display the results. After displaying the results, prompt the user to determine if another attempt (or room) is to be done. If the response is “Y[es]”, clear the screen and restart the input process, if “N[o]”, terminate the program; if neither, re-prompt the user for a correct response.
Programming requirements:
Use only standard structured techniques.
Program must make full use of functions.
The main function should only control the overall program logic.
Screen should be cleared between room input and output displays.
All screen displays must contain appropriate text.
Program must be repetitive until terminated by user.
Sample input process:
Enter room length in feet and inches: 20 9
Enter room width in feet and inches: 12 6
Enter room height in feet and inches: 7 11
How many windows are there in the room: 3
Enter width and height for window 1 in inches: 90 36
Enter width and height for window 2 in inches: 24 36
Enter width and height for window 3 in inches: 24 36
How many doors are there in the room: 2
Enter width and height for door 1 in inches: 30 84
Enter width and height for door 2 in inches: 30 84
lengthSideOfWallArea=roomLengthInFeet*roomHeightInFeet;
widthSideOfWallArea=roomWidthInFeet*roomHeightInFeet;
totalWallArea=(lengthSideOfWallArea*2)+(widthSideOfWallArea*2);
cout<<"The total wall area is "<<totalWallArea<<endl;
//get window data
cout<<"How many windows are there in the room"<<endl;
cin>>numberOfWindows;
float windowLengthsInInches[numberOfWindows];
float windowWidthsInInches[numberOfWindows];
float windowAreas[numberOfWindows];
for(int i=0;i<numberOfWindows;i++){
cout<<"Enter length of window "<<i+1<<" in inches"<<endl;
cin>>windowLengthsInInches[i];
cout<<"Enter width of window "<<i+1<<" in inches"<<endl;
cin>>windowWidthsInInches[i];
After accepting the required inputs, clear the screen and display the results. After displaying the results, prompt the user to determine if another attempt (or room) is to be done. If the response is “Y[es]”, clear the screen and restart the input process, if “N[o]”, terminate the program; if neither, re-prompt the user for a correct response.
PLEASE ALWAYS USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
I will suggest that you reread the instructions you have been given. Because your first bit of code does not follow the instructions. The main function should only control the overall program logic.
You are trying to do all of your input in main when it should be done in functions.