Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Caps Lock A S D F G Shift 12 CALL-BY-REFERENCE FUNCTION Filename: A3ques12.cpp A painting company has determined that for every 115 square feet of

image text in transcribed
Caps Lock A S D F G Shift 12 CALL-BY-REFERENCE FUNCTION Filename: A3ques12.cpp A painting company has determined that for every 115 square feet of wall space, one gallon of paint and 8 hours of labor will be required. The company charges $18.00 per hour for labor. Write a void function called estimator with three integer parameters-one for the number of square feet of wall space and the other two as reference parameters for the number of gallons and number of hours. The function can estimate how many gallons of paint and how many hours of labor based on the wall size and return these two numbers via reference parameters. In the main function, repeatedly prompt user to input an integer for square feet of wall space. Next, call the function estimator to obtain the number of gallons and number of hours. Then, prompt user to input the price for one gallon of paint. Finally calculate the total and print it each time. Requirements: You must define a function with reference variables. Input validation: do not accept a value less than or equal to 100 for the wall size (don't need to verify the price). Hint: Since the company must use an integer number of paint and labor, even use a small amount of gallon of paint, you need to use math function ceil to get an integer number. Since ceil return double data type, you need to use static_castint to get rid of compiler warning. Suggested screen design: nter an integer for wall size (-1 to end): 95 Sorry the wall size must be greater than 100. Try again Enter an integer for wall size (-1 to end): 115 Enter the price for one galllon of paint: 18 The total cost for the paint job is $162.00 Enter an integer for wall size (-1 to end): 230 nter the price for one galllon of paint: 24 The total cost for the paint job is $336.00 Enter an integer for wall oize (-1 to end): 250 Enter the price for one galllon of paint: 24 The totel cost for the paint job is $396.00 Enter an integer for wall size (-1 to end): -1 Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning PostgreSQL On The Cloud Simplifying Database As A Service On Cloud Platforms

Authors: Baji Shaik ,Avinash Vallarapu

1st Edition

1484234464, 978-1484234464

More Books

Students also viewed these Databases questions

Question

Why do mergers and acquisitions have such an impact on employees?

Answered: 1 week ago

Question

2. Describe the functions of communication

Answered: 1 week ago