This program will determine the usable area of a house. The rooms are rectangular in shape and maximum of four rooms are allowed to be calculated at once. It will use the area formula for a rectangle to find the usable area of each room and once the calculation are made for each room it will print out the total usable area of a house to the output screen.
Analysis
This program will calculate the usable area in square feet of a house with a maximum of four rooms that are rectangular in shape. The first step would be to get the required input because that is needed for the output. The first step is to get the each of the four rooms’ length and width. Then assign it to the appropriate variable. The area of a rectangle is the length multiply by the width. Then calculate the area of each room by multiplying the length by the width to find the number of square feet. Then we can find the total area by adding all the areas calculated together and that will result in the usable area of the house in square feet.
We will use sequential programming statements.
The variables that will be used to find the area square feet of each room are: area, length, width Totalarea.
Area will be used to find the usable square footage of each room.
Length and width will be the input that we need to know to get the area of each room.
Totalarea will be the sum of the area of each of the rooms that will be calculated.
Equations to the area are listed below.
Area of Room1 = length1 * width1
Area of Room2 = length2 * width2
Area of Room3 = length3 * width3
Area of Room4 = length4 * width4 totalArea = Room1+Room2+Room3+Room4
Print the totalArea
Design
Pseudo code
//This program will multiply the length and width of a maximum of four rooms in a house
//It will add the sum of the area of each room and assign it to the totalArea
//declare variables
Declare length1, width1, length2, width2, length3, width3, length4, width4, areaRoom1, areaRoom2, areaRoom3,