ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 28 Apr 2017 My Price 8.00

CS1336 Homework #3-2

language is c++

plz help!!! stuck half way through.

due at 11.59 pm tonight

 

CS1336
Homework #3-2
Assigned Feb 21, due Feb 28 at 11:59 PM
This homework assignment gives you the opportunity to practice functions, formatted output and
named constants. HW3-2 (Graded out of 100)
A painting company has determined that for every 110 square feet of wall space, one gallon of paint and
8 hours of labor will be required. The company charges $25.00 per hour for labor. Write a program that
prompts the user to enter the number of square feet of wall space to be painted and the price of the
paint per gallon. The program should then display the following information: Number of gallons of paint required
Hours of labor required
Cost of the paint
Labor charges
Total cost of the paint job Note: If the number of square feet is not a multiple of 110, for the purpose of calculating the number of
gallons of paint required and the hours of labor required, it should be rounded up to the next higher
multiple of 110. For example, if the user enters 230 square feet, the square feet are rounded up to 330,
and the program should determine that 3 gallons and 24 hours of labor are required. 1. Additional requirements – Make sure you meet all the requirements to avoid losing
points To complete the assignment, you are required to use only what has been taught in class. If you
have prior programming experience, refrain from using more advanced C++ constructs, so all the
homework programs can be graded on a consistent basis.
Make sure you follow the requirements in the “Homework Notes Function Headers”.
You are required to implement the following functions and call them in the main function:
o getPrice():This function takes no argument, prompts the user to input the price of
paint per gallon and returns the value. It also prints the price as a verification. Assume
the price entered by the user may have a fractional part
o getSquareFeet(): This function takes no argument, prompts the user to input the
number of square feet and returns the value. The value returned is not rounded up. It
also prints the number of square feet as a verification. Assume the number of square
feet entered by the user is an integer
o calcLabor():This function takes as argument the number of square feet, calculates
and returns the number of hours of labor required. If the number of square feet is not a
multiple of 110, for the purpose of calculating the hours of labor required, it should be
rounded up to the next higher multiple of 110. For example, 230 square feet would be
rounded up to 330. o calcGallons():This function takes as argument the number of square feet,
calculates and returns the number of gallons of paint required. If the number of square
feet is not a multiple of 110, for the purpose of calculating the number of gallons of
paint required, it should be rounded up to the next higher multiple of 110. For example,
230 square feet would be rounded up to 330.
o calcCostPaint(): This function takes as arguments the price of the paint per
gallon, the number of gallons, and returns the cost of the paint.
o calcCostLabor(): This function takes as arguments the number of hours of labor
and returns the labor charges.
You must use a function prototype for all the above functions
You must use named constants for:
o the hourly cost of labor and set it to $25.00
o the number of labor hours required for every 110 square feet and set it to 8
o the number of gallons of paint required for every 110 square feet and set it to 1
Your output should be formatted like below. You are not required to duplicate exactly the same
number of spaces, but (1) all the text (Gallons of paint required, etc.) must be left aligned, (2) all
the decimal points are aligned, and (3) all the $ signs are aligned. Hint: use setw() and left/right
justifications. 2. Implementation hints
This formula will divide the number of square feet by 110. If the number of square feet is not a multiple
of 110, it will round up the result (squareFeet is assumed an integer):
roundedUpMultiple = ((squareFeet-1)/110 + 1); 3. Example Output
Below are example outputs. You can test your program by typing the same input and check you get the
same output.

Answers

(11)
Status NEW Posted 28 Apr 2017 08:04 AM My Price 8.00

-----------

Not Rated(0)