Premium Essay

Cmis Hw1

In:

Submitted By cobra621
Words 348
Pages 2
CMIS102 Homework Assignment # 1

Student Name: Matt Marshall

Problem definition: 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.

A. Problem Analysis –

Desired Output: The sum of the two integers

Required Input: 2 integers. a and b

Calculations: A*B=C

B. Program Design –

This program will sum two integer numbers to receive a third integer number.

//Declare variables
Declare a,b,c as Integer
// Set values of Integers
Set a=
Set b=
Set c=a+b
// Print c
Print a,b,c

C. Program Comments and Test Data – Following the directions in the assignment, include your test data and expected results in this section. (The Comments section is for specifics about how you designed your program, any problems you had, how you solved them, lessons learned, and how you would improve the program if you had more time. This is normally used by programmers who may come back to the program later.)

Table 1. Include your test data table here. Show at least 3 examples sets of test data. Test data is normally designed before the program is written. It is used after the program is completed to test and ensure it works as it was designed to work.

|Test Case # |Input |Expected Output |
|1 |Room1: length=20, width=14; |718 square feet |
| |Room 2: length=11, width=10; | |
| |Room 3: length=12, width=14; Room 4 | |

Similar Documents

Free Essay

Cmis 102 Homework 1

...Peter Doyle CMIS 102 Prof. Tanney HW1 Purpose of the program This program will be used to determine the square feet of usable space in each individual room and those values will be added together to get the total usable area of square feet in house with length and width values of up to four rooms being the only known value BEGIN define variables for rooms and total usable space room numbers and area of each room will be will be represented by integers r1 through r4 total usable area in the house will be represented by Usable_space which define variables of length and width for r1-r4, integer l1,l2,l3,l4,w1,w2,w3,w4 //the values for length and width will be added by user input l1,w1,l2,w2,l3,w3,l4,w4 //Length will be known as L and will have the integers of L1 through L4. L1through L4 will correspsond to the the integer “L” with the same number //Width will be known as “W” and will have the integers of w1 through w4 with the numbers corresponding to the integer “w” with the same number r1=L1*w1; r2=L2*w2; r3=L3*w3; r4=L4*w4; define formula to get total usable square feet Usable_space=(r1+r2+r3+r4); Have program show with printf command Usable square feet for each room and total usable square feet: “ The individual rooms r1-r4’s (respectively) usable area in square feet is r1,r2,r3,r4. The total usable square feet of your house with those given values is Usable_space.” END Code and run test cases. If successful code is good to go. Test case...

Words: 354 - Pages: 2