Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve it in C program, and fast please! Write a program in C that calculates the squares footage for a house. The very first thing

Solve it in C program, and fast please! image text in transcribed
Write a program in C that calculates the squares 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 rooms. 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 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 upon which location was sent. The smallest room in the house is tie 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 out moodle class online

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

Advances In Spatial And Temporal Databases 10th International Symposium Sstd 2007 Boston Ma Usa July 2007 Proceedings Lncs 4605

Authors: Dimitris Papadias ,Donghui Zhang ,George Kollios

2007th Edition

3540735399, 978-3540735397

More Books

Students also viewed these Databases questions

Question

9. Describe the characteristics of power.

Answered: 1 week ago

Question

Consider this article:...

Answered: 1 week ago