Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Instructions In this homework, you will design a program to perform the followin

ID: 646415 • Letter: I

Question

Instructions

In this homework, you will design a program to perform the following task:

Calculate the usable area in square feet of house. Assume that the house has a maximum of four rooms, and that each room is rectangular.

There are 4 components of your submission including:

Program Description- A brief, clear description of the program you are building.

Analysis: address the following items:  

What are the inputs?

What are the outputs?

How will you obtain the required output from the inputs?

Describe any mathematical formulas you are going to use.

Provide a table listing the variables you will use, giving the name, data type, and usage of each.

Test plan - Prepare at least 3 sets of input data (Test data) along with their expected output for testing your program. Present your test data in the form of a table as shown below.

Pseudocode- Provide pseudocode of your overall design that fulfills the requirements of the project.

All of these components can be placed in Word document.

Example test data:

Test Case #

Input

Expected Output

1

Room1: length=10, width=14;
Room 2: length=9, width=10;
Room 3: length=12, width=12;

374 square feet

2

Your room dimensions

Your output

3

Your room dimensions

Your output

Test Case #

Input

Expected Output

1

Room1: length=10, width=14;
Room 2: length=9, width=10;
Room 3: length=12, width=12;

374 square feet

2

Your room dimensions

Your output

3

Your room dimensions

Your output

Explanation / Answer

/*
DESCRIPTION
------------------------------------------------------------------------------------------------------------
This program takes as input the number of rooms and the dimensions
of each of the rooms and calculate the total area i.e sum of all indiviual rooms
--------------------------------------------------------------------------------------------------------------

*/
/*
INPUT
-----------------------------------------------
variable name dataType usage

1 ) rooms int to takes number of rooms
2) length int input length
3)breadth int input breadth
4)totalUsableArea int contains the output
*/
#include<iostream>

using namespace std;
int main(){
int rooms;
int totalUsableArea = 0;
cout << "Enter the number of rooms : ";
cin >> rooms;
int i = 1;
while(rooms--){
int length, breadth;
cout << "Enter dimensions of Room " << i << " : ";
cout << "Length : ";
cin >> length;
cout << "Breadth : ";
cin >> breadth;

totalUsableArea += length*breadth;
}

cout << "The Total Usable Area is " << totalUsableArea << "square feet ";

return 0;
}