Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in c++ please HW05: Square Feet With the housing market the way it is, you need to make quick mental calculations fast! Sometimes that's not
in c++ please
HW05: Square Feet With the housing market the way it is, you need to make quick mental calculations fast! Sometimes that's not so easy to do after a long day, so how about writing a computer program that will calculate the square footage of a house for you? The program should prompt the user for the total number of rooms in the house, then allow the user to enter the length and width of each room individually. After all the data entry has been performed, the program should display the total square footage of the house. Here's what a sample run looks like How many rooms? 5 Room #1: Enter length: 20 Enter width: 35 Room #2: Enter length: 18.7 Enter width: 25.3 Room #3: Enter length: 12.1 Enter width: 15 Room #4: Enter length: 28.6 Enter width: 22.2 Room #5: Enter length: 26 Enter width: 11.4 The total square feet is 2285.9300 A few things to take note of: . The values entered may contain decimal points. The total square feet is expressed as a floating point value The total square feet uses four digits of precision. Naturally, since this is a programming class you don't get to write this program any which way you prefer, there are a few rules to this game The main function will be responsible for getting the number of rooms from the user. Then this value is passed as input to the CalcSquareFeet function. What CalcSquareFeet does is prompt the user for the length and width of each room and return the total square footage to the caller. However, to derive the area of a single room, CalcSquareFeet will call on another function CalcArea. This function will receive length and width values for a single room and return the area back to the caller As usual, make sure you're clear on how information is getting passed around before writing any code. An excellent way to get started is to first sketch out the program with a structure chart, that way you'll have a better idea of the function call hierarchy, as well as the data flow among the functions. You can save your code in the HW05 subdirectory in a file called squarefeet.cpp. Good luckStep 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