Hi i hve to turn in this homework today and i have not been able to come up with the logic here is what it is need it and what i have wrote so far if you are interested i am willing to pay for it, thanks

Program Description:
A painting company has determined that for every 110 square feet of wall space, one gallon of paint and six hours of labor will be required. The company charges $15.00 per hour for labor. Write a program that displays the following menu:
Paint Job Estimator Menu
1. Get Paint Job Estimate
2. Quit
Enter your choice:
If the user enters 1, the program should ask the user to enter the number of rooms that are to be painted, the price of the paint per gallon, and the square feet of wall space in each room. It should then display the following data:
• The number of rooms to be painted
• The number of whole gallons of paint required (i.e. if only 8.5 gallons are needed, the company would charge for 9 gallons)
• The hours of labor required (this should be a multiple of 6: i.e. 6, 12, 18, etc. )
• The cost of the paint
• The labor charges
• The total cost of the paint job
Hint: Use the ceil function to round up. You must include <cmath>.
After the paint job estimate is displayed, the menu should be displayed again. The number of rooms must be at least 1, the price of the paint per gallon must be at least $15.00, and the area for the wall space of each room must be greater than 10 square feet. All input validation must be performed with a loop.
If the user enters 2, the program should end. If the user enters an invalid choice, an appropriate error message should be displayed, and he/she should be asked to enter another choice. The program should use a loop to validate the user’s choice.
Your program must have at a minimum the following functions:
• getUserData: Inputs the number of rooms to be painted, the price of the paint per gallon, and the total square feet of wall space to be painted. The total square feet of wall space to be painted is the sum of the areas of all the rooms. The screen should be cleared before prompting the user for the data.
• showMenu: Displays the menu. The screen should be cleared before the menu is displayed.
• clearScreen: Clears the screen.
• pauseScreen: Pauses the screen.
• calcGallonsOfPaint: Calculates the number of whole gallons of paint required.
• calcCostOfPaint: Calculates the cost of the paint required.
• calcHoursOfLabor: Calculates the number of whole hours of labor required.
• calcLaborCost: Calculates the labor charges.
• calcPaintJobCost: Calculates the cost of the paint job. This is the sum of the labor charges and the cost of the paint required.
• showReport: Displays a formatted report of the data mentioned above. The screen should be cleared before displaying the report. In addition, the screen should be paused after the report is shown.
• doEstimate: This function calls the appropriate functions to perform the estimate. That is, the logic to process choice 1 should be placed inside this function, not in main.
Remark: Remember, one of the goals of dividing a program into modules (functions) is to reduce the complexity of the main function. Therefore, the main function should be straight forward and simple to understand. Points will be deducted for having a complex main function.
Other Requirements:
• Remember that a function argument and its corresponding parameter are two distinct variables, which occupy different storage locations in memory. To make sure, you don't confuse an argument with its corresponding parameter, I want you to name them differently.
• Your program may NOT use global variables unless they are constants. (-50 pts for each global variable that is not a constant.)
• The name of a variable or function should reflect its purpose.
• Place the function prototypes above main ( ), and the function definitions below main ( ).
• Remember, reference parameters should only be used, if they are going to modify the original arguments. Otherwise, you must use value parameters.

#include <iostream> // input, output library
#include <iomanip> // manipulator library
#include <cmath> 
#include <cstdlib> 
#include <fstream>

using namespace std;

void getUserData ();
void showMenu ();

int main()

    float choice; 
    float rooms = 0;
    float gallon;
    float squarefeet;
    float hours;
    float cost;
    float labor;
    double totalcost;
    float totalgallons;
    float totalgneeded;

    cout << "\t\1. Get Paint Job Estimate.\n";
    cout << "\t\2. Quit.\n";
    cout << "\t\3. Enter your choice: ";
    cin  >> choice;

    cout << fixed << showpoint << setprecision(2);

    while (choice <= 0)

    cout << "\t\ Error invalid entry" << endl;
    cout << "\t\ the option enter shoulb be 1 or 2" << endl;
    cout << "\t\ Please re-enter your choice: ";
    cin >> choice;

    if (choice == 1)
        cout << endl;
        cout << "\t\ Please enter # of rooms to be painted: ";
        cin >> rooms;
        while ( rooms < 1 ) 
            cout << endl;
            cout << "\t\ Your input was invalid. # of rooms must be at least 1. "<< endl;
            cout << "\t\ Please re-enter # of rooms to be painted: ";
            cin >> rooms;

        cout << "\t\ Please enter the price of each gallon:$ ";
        cin >> gallon;
        while ( gallon < 15 ) 
            cout << endl;
            cout << "\t\ Your input was invalid. price per gallon shoul be at least $15.00. "<< endl;
            cout << "\t\ Please re-enter price of each gallon:$ ";
            cin >> gallon;

        cout << "\t\ Please enter the square feet per each room: ";
        cin >> squarefeet;
        while ( squarefeet < 10 ) 

            cout << endl;
            cout << "\t\ Your input was invalid. space of each room must be grater than 10 sqft. "<< endl;
            cout << "\t\ Please re-enter square feet per each room: ";
            cin >> squarefeet;



        hours = rooms * 6;
        cost = (gallon * rooms) * (squarefeet / 110);
        totalgallons = squarefeet / 110 ;
        totalgneeded = totalgallons * rooms;
        labor = hours * 15;
        totalcost = labor + cost; 

    cout << endl;
    cout << "\t\ Number of rooms to be painted: " << rooms << endl;
    cout << "\t\ Number of whole gallons to be used: " << totalgneeded << endl;
    cout << "\t\ Hours of labor required to complet job: " << hours << endl;
    cout << "\t\ Cost of paint: $" << cost << endl;
    cout << "\t\ The Labor Charges are: $" << labor << endl;
    cout << "\t\ Total cost for the paint job: $" << totalcost << endl;

    else if (choice == 2)

            return EXIT_SUCCESS;

    cout << endl;


    return EXIT_SUCCESS;


as you see this program does what is need it but i need to use the functions in main in order to make the program better

Edited by Nick Evan: Fixed formatting

6 Years
Discussion Span
Last Post by Fbody

Please use code tags when you post code. Also, DaniWeb has a "Looking to Hire" forum that you should post something like this "willing to pay..." post in.




Seen this one before. It's very easy if you actually try. It probably took you longer to type the post than it would have taken you to do the assignment...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.