Free Essay

Housesqft Cmis102

In:

Submitted By Daverz69
Words 640
Pages 3
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 * width3 (float variable)
Area4 = length4 * width4 (float variable)
Area1 + Area2 + Area3 + Area4=TotalArea (float variable)

This is the Fundamental Task we must complete for this program... Below is an outline

Input the data.

Input variables length1, width1, length2, width2, length3, width3, length4, width4
Perform Calculations
TotalArea=area1+area2+area3+area4 where: area1=length1*width1 area2=length2*width2 area3=length3*width3 area4=length4*width4
Output Results
Display the “TotalArea” of the House (in sqft)

Declare totalArea As Float
Declare length1 As Float
Declare width1 As Float
Declare length2 As Float
Declare width2 As Float
Declare length3 As Float
Declare width3 As Float
Declare length4 As Float
Declare width4 As Float
Write “This Program Will Calculate The Area In Square Feet Of A Four Room House”
Call Input Data module
Call Peform Calculations module
Call Output Results module
End Program

Input Data module
Write “What is the 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 length2
Write “What is the width of Room 2?”
Input width2
Write “What is the length of Room 3?”
Input length3
Write “What is the width of Room 3?”
Input width3
Write “What is the length of Room4?”
Input length4
Write “What is the width of Room 4?”
Input width4
Perform Calculations Module
Declare Area1 As Float
Declare Area2 As Float
Declare Area3 As Float
Declare Area4 As Float
Set Area1 = length1 * width1
Set Area2 = length2 * width2
Set Area3 = length3 * width3
Set Area4 = length4 * width4
Set TotalArea = Area1 + Area2 + Area3 + Area4
Output Results Module
Write “The Total Square Footage Of The House Is:” + TotalArea

C. Program Comments and Test Data – Following the directions in the assignment, include your test data and expected results in this section.

Table 1. Include your test data table here

|Input: Room length and width (in feet) |Expected output: Total square footage of house |
|Room 1: length=14, width=9 |565 |
|Room 2: length=13, width=10 | |
|Room 3: length=12, width=12 | |
|Room 4: length=15, width=11 | |
|Room 1: length=16.5, width=11.5 |738.25 |
|Room 2: length=14, width=10 | |
|Room 3: length=17, width=13 | |
|Room 4: length=15, width=12.5 | |
|Room 1: length=18, width=12 |864 |
|Room 2: length=18, width=12 | |
|Room 3: length=18, width=12 | |
|Room 4: length=18, width=12 | |

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.

...CMIS102 Homework Assignment 1 Student Name: Neal Fowler Class/Section: CMIS 102 Section 6385 Professor Name: Marie Arvi Assignment due date: 6 January 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: 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...

Words: 472 - Pages: 2