Question
Youve been hired by Leaf Lifters to write a C++ console application that estimates the cost to rake leaves from a lawn. Use validation loops
Youve been hired by Leaf Lifters to write a C++ console application that estimates the cost to rake leaves from a lawn. Use validation loops to prompt for and get from the user the length and width of the lawn in the range 30-300. The units may be in yards or meters. Calculate the area and perimeter of the lawn. Then, estimate the cost to rake the lawn. If the area to rake is less than or equal to 3,000 square yards / square meters, use a rate of $0.03 per square yard / square meter. If the area to mow is more than 3,000 square yards / square meters, use a discounted rate of $0.02 per square yard / square meter. Define constants for the two rates. Format the two inputs and four outputs (area, perimeter, rate, cost) in two columns with the first column containing a label and the second column containing the value. Include the units (yards, meters, square yards, square meters, etc.) for each input/output value, and show one input/output per line. Format any real numbers to two decimal places. For your last run, use a length of 35 and a width of 45.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started