Free Essay

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

Submitted By abelpat
Words 801
Pages 4
CMIS102 Homework Assignment 1

Student Name: Abel Patrick Assizo
Class/Section: CMIS 102 Section 7986
Professor Name: Jose Romero
Assignment due date: April 1, 2012

Assignment: 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. 1) Problem analysis
This Program is intended to compute the area of a house composed of four rectangular rooms. Indeed, for this problem, we need to output the value of the total area of the house after finding and summing the areas of each room. For this to be possible, we will define output and input variables.
Therefore, for this program, we will need to output the value of the following variable: * The value of the area of the house total_area (a Float variable)
We will also need to input the value of the length and width of each room, subsequently the following variables: * The value of the length of the first room length1 (a Float variable) * The value of the width of the first room width1 (a Float variable) * The value of the length of the second room length2 (a Float variable) * The value of the width of the second room width2 (a Float variable) * The value of the length of the third room length3 (a Float variable) * The value of the width of the third room width3 (a Float variable) * The value of the length of the fourth room length4 (a Float variable) * The value of the width of the fourth room width4 (a Float variable)

We will also need to define the value of others variable necessary to obtain the value of our output. The values of these variables are obtained based on the formula of the area of a rectangle: Area = length * width
For example, if a room is 10 feet long and 5 feet wide, its area is: Area = 10 * 5 = 50 square feet
If we have a house with four identical rooms, the area of the house will be: Area of the house = area room1 + area room2 + area room3 + area room4 = 50+50+50+50 = 200 square feet
Therefore, the variables which will be used and their formulas are: * The value of the area of the first room area1 (a Float variable) area1 = lenght1 * width1 * The value of the area of the second room area2 (a Float variable) area2 = lenght2 * width2 * The value of the area of the third room area3 (a Float variable) area3 = lenght3 * width3 * The value of the area of the fourth room area4 (a Float variable) area4 = lenght4 * width4
The formula of the area of the house will be then: total_area = area1 + area2 + area3 + area4 2) Program design

In order to implement our program, we need to perform three main fundamental tasks: a- Input data:
Input the variable lenght1, widht1, lenght2, widht2, lenght3, widht3, lenght4 and widht4 b- Perform calculations:
Compute the area of the house and the area of each room using the following formulas: total_area = area1 + area2 + area3 + area4 where area1 = lenght1 * width1 and area2 = lenght2 * width2 and area3 = lenght3 * width3 and area4 = lenght4 * width4 c- Output result:
Display the total area of the house (total_area)

The overall design of the program will be modular and will look like: Main module Declare total_area As Float Declare lenght1, lenght2, lenght3, lenght4 As Float Declare width1, width2, width3, width4 As Float Write “This program will compute the area of a four room house.” Call Input Data module Call Perform Calculations module Call Output Result module End Program Input Data module Write “Length of the first room: ” Input lenght1 Write “Width of the first room: ” Input width1 Write “Length of the second room: ” Input lenght2 Write “Width of the second room: ” Input width2 Write “Length of the third room: ” Input lenght3 Write “Width of the third room: ” Input width3 Write “Length of the fourth room: ” Input lenght4 Write “Width of the fourth room: ” Input width4 Perform Calculations module Declare area1, area2, area3, area4 As Float Set area1 = lenght1 * width1 Set area2 = lenght2 * width2 Set area3 = lenght3 * width3 Set area4 = lenght4 * width4 Set total_area = area1 + area2 + area3 + area4 Output Result module Write “The area of the house is: ” + total_area 3) Test Data

Input: Room length and width (in feet) | Expected output: Total square footage of house (in square feet) | Room1: length=10, width=14;Room 2: length=9, width=10;Room 3: length=12, width=2;Room 4: length= 5, width= 6 | 284 | Room1: length=1, width=14;Room 2: length=17, width=10;Room 3: length=12, width=14;Room 4: length= 43, width= 9 | 739 | Room1: length=4, width=8;Room 2: length=9, width=10;Room 3: length=18, width=12; | 338(This home does not have a fourth room, so length and width of this equal 0 ) |

Similar Documents

Free Essay

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.

...Problem definition: 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. A. Problem Analysis: What is the required output? Total square footage of a house (in square feet) What is the necessary input? Room 1, 2, 3, and 4 length and width. How will we obtain output from input? Each room length and width input multiplied. Next all four rooms total add together for output. B. Program Design: 1. Input data: Input the variables Rm1L, Rm1W, Rm2L, Rm2W, Rm3L, Rm3W, Rm4L, Rm4W 2. Perform calculations: where… Rm1sqft = Rm1L * Rm1W, Rm2sqft = Rm2L * Rm2W, Rm3sqft = Rm3L * Rm3W, Rm4sqft = Rm4L * Rm4W, where… Housesqft = Rm1sqft + Rm2sqft + Rm3sqft + Rm4sqft 3. Output results: Display the total square feet (Housesqft) of the house // House Measurement Computation // Programmer: Neal Fowler Main module // Declare Variables Declare Rm1L Declare Rm1W Declare Rm2L Declare Rm2W Declare Rm3L Declare Rm3W Declare Rm4L Declare Rm4W Declare Rm1sqft Declare Rm2sqft Declare Rm3sqft Declare Rm4sqft Declare Housesqft Write “Home Measurement Program” Write “This program computes the total” Write “square feet (living space) of a house.” Call Input Data module Call Perform Calculations module Call Output Results module End Program Input Data module // Get the measurements of each room Write “What is room 1 length?” Input Rm1L Write “What is room 1......

Words: 472 - Pages: 2

Free Essay

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.

... Problem definition: 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. A. Problem Analysis 1. What is the usable living area of 4 room house (output) 2. What is the length of room 1 (length1) - input 3. What is the width of room 1 (width2) – input 4. What is the sq footage of room1 (sqft1)– float variable 5. What is the length of room 2 (length2) - input 6. What is the width of room 2(width2) – input 7. What is the sq footage of room2(sqft2) – float variable 8. What is the length of room 3(length3) – input 9. What is the width of room 3(width3) - input 10. What is the sq footage of room3(sqft3) – float variable 11. What is the length of room 4 (length4)- input 12. What is the width of room 4 (width4)– input 13. What is the sq footage of room4(sqft4) – float variable 14. Add each sq footage together for total living area – float variable Formulas – sq footage=length*Width Total living area=sq footage1+sqfootage2+sqfootage3+sqfootage4 B. Program Design – Following the directions in the assignment, clearly write up your problem design in this section and comment your pseudocode. Input date module Write “What is length of room 1” Input length1 Write “What is the width of room 1” Input width1 Write “What is the length of room 2” Input......

Words: 478 - Pages: 2

Free Essay

Assignment1

...Homework #1 Calculate the usable area in square feet of a house. Assume that the house has a maximum of four rooms, and that each room is rectangular. Program Description The purpose of this program is to calculate the usable area (square feet) of a four room house. Analysis To calculate the usable area in square feet in the house I would first need to identify the inputs and outputs. I know the house has a maximum of 4 rooms that are rectangular in shape, this is my input. Using the area formula (L x W) I can determine the square feet for each room. Adding the square feet for each room will provide the amount of usable area in square feet of the house and my output for this program. Test Plan Test Case # | Input | Expected Output | Results | 1 | Room 1: length = 16, width = 14Room 2 length = 13, width = 13Room 3: length = 10, width = 11 | 503 square feet | Pass | 2 | Room 1: length = 12, width = 16Room 2 length = 11, width = 14Room 3: length = 10, width = 11 | 456 square feet | Pass | 3 | Room 1: length = 12, width = 12Room 2 length = 12, width = 11Room 3: length = 11, width = 10 | 386 square feet | Pass | Pseudocode //This program will calculate the usable area in square feet of a four room house //Declare WidthRoom1, LengthRoom1 As Float // Declare WidthRoom2, LengthRoom2 As Float //Declare WidthRoom3, LengthRoom3 As Float //Declare WidthRoom4, LengthRoom4 As Float //Declare TotalHouseSquareFeet As Float Write “This program will help you......

Words: 273 - Pages: 2

Free Essay

Assignment1

...problem here is to calculate the usable area in square feet of house. We are to assume that the house has a maximum of four rooms, and that each room is rectangular. Problem Analysis Objective: Devise a program that calculates the usable area of a house. This is minimally what is being requested. • Outputs: This problem calls for a simple output, the total usable square foot of the house, with a maximum of four rooms, each room being rectangular. Total number of square foot = Area of Room1 + Area of Room2 + Area of Room3 + Area of Room4 • Inputs: The problem will require us to know the length and width of each of the four rectangular rooms in order to compute the correct output, the total number of square foot. The length multiplied by the width of each of the four rectangular rooms will give us area of each room. We will receive these data points by measuring the dimensions of the room. Length1 x Width1 = Area of Room1 • Calculation Approach: In order to calculate the Total Square Foot of the house, we will need to take the sum of the areas of each room. o Area of Room 1 = Length of Room1 x Width of Room1 o (Repeated four times – once for each room) o Total Square Foot of House = Area of Room1 + Area of Room2 + Area of Room3 + Area of Room4 • Define variables: AreaofRoom1 = square foot area of the room 1 AreaofRoom2 = square foot area of the room 2 ......

Words: 928 - Pages: 4

Free Essay

Calculate Square Footage

...definition: 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. A. Problem Analysis – Following the directions in the assignment, clearly write up your problem analysis in this section. In this program the overall goal is to obtain the usable area in square feet in a house. The results or overall goal would be considered the required output. To obtain the required output we would need the necessary input. The necessary information regarding the house is that it contains a maximum of four rooms that are rectangular in shape. I will obtain the required output from the given input by multiplying length x width to find the number of square feet in each rectangular room. Once the combined square footage of each room is determined this will give me the amount of usable living space. We would need to know each room length and width, then calculate each rooms area and then find the sum of all four rooms. Area of Room 1= Length1 x Width1 Area of Room 2= Length2 x Width2 Area of Room 3= Length3 x Width3 Area of Room 4= Length4 x Width4 Area of Room 1 + Room 2 + Room 3 =Room 4 = Total Square footage B. Program Design – Following the directions in the assignment, clearly write up your problem design in this section and comment your pseudocode. Useable square footage of a house Rooms- Total number of Rooms = 4 Area-Area=L x W of each room Variables= Length, width, area ......

Words: 643 - Pages: 3

Homework1

...CMIS102 Homework Assignment 1 (Worth 13% of your grade) Problem definition: 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. A. Problem Analysis – Following the directions in the assignment, clearly write up your problem analysis in this section. In order to determine the usable area of the house I must first find out what is the total square feet area of each of the four rooms. I know that to get the area of each room I have to multiply LengthFeet X WidthFeet and that will give me the area of a 1 Room. Then I must do this to all four rooms, therefore, the results of the total area of the four rooms will give me the usable area of the house. My output variables are: UsableAreaFeet (float variable), AreaOfRoomFeet (float variable). Input variables: Length (float variable) and Width (float variable) and AreaOfRoomFeet (float variable). Formulas need it: AreaOfRoomX=Length X Width Where X is rooms 1-4, UsableAreaFeet=AreaOfRoom1Feet + AreaOfRoom2Feet + AreaOfRoom3Feet + AreaOfRoom4Feet B. Program Design – Following the directions in the assignment, clearly write up your problem design in this section and comment your pseudocode. PseudoCode Input Data Module: Input: LengthFeet, WidthFeet, AreaOfRoomXFeet Perform Calculations Module Compute: AreaOfRoomXFeet Here the formula use will be AreaOfRoomX = Length X Width Compute: UsableAreaFeet Here I will......

Words: 560 - Pages: 3

Problem

...Problem definition: 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. A. Problem Analysis – Following the directions in the assignment, clearly write up your problem analysis in this section. In order to determine the usable area of the house I must first find out what is the total square feet area of each of the four rooms. I know that to get the area of each room I have to multiply LengthFeet X WidthFeet and that will give me the area of a 1 Room. Then I must do this to all four rooms, therefore, the results of the total area of the four rooms will give me the usable area of the house. My output variables are: UsableAreaFeet (float variable), AreaOfRoomFeet (float variable). Input variables: Length (float variable) and Width (float variable) and AreaOfRoomFeet (float variable). Formulas need it: AreaOfRoomX=Length X Width Where X is rooms 1-4,   UsableAreaFeet=AreaOfRoom1Feet + AreaOfRoom2Feet + AreaOfRoom3Feet + AreaOfRoom4Feet B. Program Design – Following the directions in the assignment, clearly write up your problem design in this section and comment your pseudocode. PseudoCode Input Data Module: Input: LengthFeet, WidthFeet, AreaOfRoomXFeet Perform Calculations Module Compute: AreaOfRoomXFeet   Here the formula use will be AreaOfRoomX = Length X Width Compute: UsableAreaFeet         Here I will use the this equation: UsableArea = AreaOfRoom1 + AreaOfRoom2 +...

Words: 285 - Pages: 2

Free Essay

Cmis102 Hw1

...following task: Calculate the usable area in square feet of a house. Assume that the house has a maximum of four rooms, and that each room is rectangular. I. Problem Analysis 1.) To find the usable area in square feet of a house, what is the necessary input needed to solve the problem? -Each room needs to be declared so that the program will know where each measurement belongs. Room#1 will be WidthFeet1 and LengthFeet1. -Use the command of “input” which will allow the user to input the values the program will need to calculate. -Use the command of “write” to let the user know what value is needed, i.e., Write “What is the length of room one in feet?” To ask the user “What is the length of room one in feet?” Use that statement and function for each room. 2.) To find the usable area in square feet of a house, what are the necessary outputs needed to solve the problem? -Use the “write” command to give the user information about the data collected and computed. Example: Write “The usable square footage of the house is:” + TotalSquarefeet -I want to display to the user the areas of each room and total usable space. -I will use “+TotalSquarefeet” to show the user the value of the data 3.) To find the total usable living space in square feet of a house, what are the steps needed to solve the problem? -In order to solve this problem, I need to know how to calculate the area of a rectangle. This formula is square feet=......

Words: 776 - Pages: 4

Free Essay

Calculating Sq Footage of a Room

...Problem definition: 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. A. Problem Analysis – Following the directions in the assignment, clearly write up your problem analysis in this section. |Input |Processing |Output |roomWidth |Read roomWidth |totalArea |roomLength |Read roomLength | |Calculate area | |Calculate totalArea | |Display totalArea B. Program Design – Following the directions in the assignment, clearly write up your problem design in this section and comment your pseudocode. Begin Declare roomWidth, roomLength, area, totalArea = 0 Write “Please enter the width and length of room 1: “ Input roomWidth Input roomLength Set area = roomWidth * roomLength Set totalArea = totalArea + area Write “Please enter the width and length of room 2......

Words: 331 - Pages: 2

Free Essay

Cmis 102

Words: 420 - Pages: 2

...November 2013 Problem definition: 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. A. Problem Analysis – Following the directions in the assignment, clearly write up your problem analysis in this section. a. What is the required output? i. Total square feet of the house. TotalSquareFeet b. What is the necessary input? i. Length of each room. Length# ii. Width of each room. Width# iii. Square feet of each room. SquareFeet# c. How will we obtain the required output from the given input? i. SquareFeet# = Length# x Width# ii. TotalSquareFeet = SquareFeet1 + SquareFeet2 + SquareFeet3 + SquareFeet4 d. Variable names and definitions. i. TotalSquareFeet = The total square feet of the house. ii. Length# = The length of the room with the corresponding number. iii. Width# = The width of the room with the corresponding number. iv. SquareFeet# = The total square feet of the room with the corresponding number. B. Program Design – Following the directions in the assignment, clearly write up your problem design in this section and comment your pseudo code. Total Square Feet of the house Rooms – Total number of rooms = 4 SquareFeet = Length x Width of each room Variables = TotalSquareFeet,......

Words: 257 - Pages: 2

Free Essay

Housesqft Cmis102

...CMIS102 Homework Assignment 1 (Worth 13% of your gradeProblem definition: 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. A. Problem Analysis – Following the directions in the assignment, clearly write up your problem analysis in this section. The primary goal is to calculate the square footage of a 4-room house. In order to do this, we need to know each room’s length and width, then calculate the area of each room and lastly find the sum of the area of each of the four rooms.  * Area of Room1=length1*width1 * Area of Room2=length2*width2 * Area of Room3=length3*width3 * Area of Room4=length4*width4 Total Number of Square Feet = Area of Room1+ Area of Room2+ Area of Room3+ Area of Room4 B. Program Design – Following the directions in the assignment, clearly write up your problem design in this section and comment your pseudocode. We need to output the value of the total area of the house after finding and summing the areas of each room. For this to be possible, we will define the input and output variables. Variables Length of Room 1 = length1 (Float) (followed to) Length of Room 4 = length4 (Float) Width of Room 1 = width1 (Float) (followed to) Width of Room 4 = width4 (Float) Additional Variables Area = length*width Area1 = length1 * width1 (float variable) Area2 = length2 * width2 (float variable) Area3 = length3 *......

Words: 640 - Pages: 3

Free Essay

Data

...due date: 08/31/2014 Problem definition: 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. A. Problem Analysis – Following the directions in the assignment, clearly write up your problem analysis in this section. Problem= We are trying to find out what the square footage of each room of a house and the square footage of the entire house. The input would include the length and width of each room and the formula to find the answer. The output would need to include the square footage of each room and the total square footage of the house. If all the code is properly executed, we will be able to input any sized room and quickly be able to find the square footage. B. Program Design – Following the directions in the assignment, clearly write up your problem design in this section and comment your pseudocode. Main module Declare EntireHouse As String Declare LivingRoom, As Float Declare Kitchen As Float Declare BedRoom As Float Declare BathRoom As Float Write “Square Footage Program” Write “This program computes the square footage of individual rooms and” Write “the total area of houses” Call Input Data module Call Perform Calculations module Call Output Results module End Module Input Data Module Write “What is the length of the room?” Input RoomLength Write “What is the width of the room?” Input RoomWidth Perform......

Words: 283 - Pages: 2

Free Essay

Cmis102 Homework Assignment 1

...definition: 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. A. Problem Analysis – Following the directions in the assignment, clearly write up your problem analysis in this section. You need to determine the area of 4 rooms added together so you will need to allow the user to input both length and width for 4 separate rooms. You will then need to write code to multiply the length and width of each room separately and then add all four together. All variables will need to be float in anticipation of fractions of feet. length1 = first room length width1 = first room width area1 = area of first room length2 = second room length width2 = second room width area2 = area of second room length3 = third room length width3 = third room width area3 = area of third room length4 = fourth room length width4 = fourth room width area4 = area of fourth room totalarea = final output variable for total square feet of home B. Program Design – Following the directions in the assignment, clearly write up your problem design in this section and comment your pseudocode. Main Write "What is the room one's length in feet?" Declare length1 As Float Input length1 Write "What is the room one's width in feet?" Declare width1 As Float Input width1 Declare area1 As Float Set area1 = width1 * length1 Write "What is the room two's length...

Words: 495 - Pages: 2