Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Solve it in C program please. Write a program in C that calculates the square footage for a house. The very first thing your program
Solve it in C program please.
Write a program in C that calculates the square footage for a house. The very first thing your program should do is to print your full name using a printf(). The main() function should ask the user for the dimensions of 5 rooms (length and width) using a for loop. For each room, the main() function will call a function called calcArea() which will calculate and return the area for a room, given the length and width. The returned area will then be loaded into an array called room. The rooms that the user will be entering, in order, are as follows: Kitchen, Bathroom, Living Room, Master Bedroom and Second Bedroom. (You do not need to tell them this - assume they already know - See output on next page!) Once the areas for all five rooms have been loaded into the array, the main() function will call a function called calcSquareFeet() which will add up the total areas of all the rooms and return the total square footage of the house. Your main() function will then print out the following message: The total square footage for this house is 1575 sq.ft. Next, your program should call a function called findValues() that will find the location in the array of the largest room in the house and the location in the array of the smallest room in the house. This information (the array locations of the largest and smallest) is to be returned to the main function. Your main() function will then send the location of the largest room in the house to a function called printRoom() which will print the following message depending upon which location was sent. The largest room in the house is the Kitchen. Your main() function will then send the location of the smallest room in the house to the same function called printRoom() which will then print the following message depending upon which location was sent. The smallest room in the house is the Bathroom. Your code is expected to be commented and written professionally (indent, readable) but you do NOT need data validation for this program. You must print a copy of your source code AND upload your .c or .cpp file to our moodle class online 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