Submitted By pickle

Words 294

Pages 2

Words 294

Pages 2

Problem Analysis

In this Program , the aim is to calculate the square feet of a 4 –room house

So we need to know each rooms length and breadth , then calculate each rom’s area and the find the sum of those

Area of Room1=length1*breadth1

Area of Room2=length2*breadth2

Area of Room3=length3*breadth3

Area of Room4=length4*breadth4

Total Number of Square Foots = Area of Room1+ Area of Room2+ Area of Room3+ Area of Room4

Program Design

Pseudocode

Start

Declare the variables i,j as interger length[4], breadth[4],area[4] as double array sum as double

Display “Enter the Rooms length and Breadth”

For i= 1 to 4 do Accept length[i], breadth[i]

Next i

Display “Finding Area and total number of square foots”

Set sum=0

For i= 1 to 4 do Area[i]= length[i]* breadth[i] Sum=sum+Area[i]

Next i

Display “Total number of square foots”, sum

Stop

Program Comments and Test Data

C++ code

#include<iostream>

#include<string>

using namespace std;

int main()

{

int i,j; double length[4], breadth[4] ,area[4], sum;

cout<<"\nEnter the length and breadth of each room"; for (i=0;i<4;i++)

{

cout<<"\nRoom "<<i+1<<" Length :"; cin >>length[i]; cout<<"\nRoom "<<i+1<<" Breadth :"; cin >>breadth[i];

}

sum=0; for (i=0;i<4;i++)

{

area[i]=length[i]* breadth[i]; sum=sum+area[i];

}

cout<<"\nTotal number of square foots :"<<sum<<endl;

return 0;

}

Test data and…...

...Program that will calculate the number of square feet (living space) in a 4-room house. Problem Analysis In this Program , the aim is to calculate the square feet of a 4 –room house So we need to know each room’s length and breadth, then calculate each room’s area and the find the sum of those Area of Room1=length1*breadth1 Area of Room2=length2*breadth2 Area of Room3=length3*breadth3 Area of Room4=length4*breadth4 Total Number of Square Foots = Area of Room1+ Area of Room2+ Area of Room3+ Area of Room4 Program Design Pseudocode Start Declare the variables i,j as interger length[4], breadth[4],area[4] as double array sum as double Display “Enter the Rooms length and Breadth” For i= 1 to 4 do Accept length[i], breadth[i] Next i Display “Finding Area and total number of square foots” Set sum=0 For i= 1 to 4 do Area[i]= length[i]* breadth[i] Sum=sum+Area[i] Next i Display “Total number of square foots”, sum Stop Program Comments and Test Data Test data and Output Example application 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=12; Room 4: length=11, width=9 473 Room1: length=20, width=10; Room 2: length=15, width=10; Room 3: length=20, width=10; Room 4: length=30, width=10 850 Room1: length=20, width=15; Room 2: length=10, width=5; Room 3:......

Words: 276 - Pages: 2

...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. Before attempting this exercise, be sure you have completed all of chapter 2 and course module readings, participated in the weekly conferences, and thoroughly understand the examples throughout the chapter. There are 3 main components of your submission including the problem analysis, program design and documentation, and sample test data. • 1. Using a similar approach as example 2.3 (textbook page 75): "Finding the Sale Price of Items in a Department Store", provide your analysis for the following problem statement: You need to write a program that will calculate the number of square feet (living space) in a 4-room house. Your analysis should be clearly written and demonstrate your thought process and steps used to analyze the problem. Be sure to include what is the required output? What is the necessary input and how you will obtain the required output from the given input? Also, include your variable names and definitions. Be sure to describe the necessary formulas and sample calculations that might be needed. • 2. Using a similar approach as the example provided in section 2.2(textbook page 78) for "The Sale Price Program continued", provide your programdesign for the program you analyzed for calculating the number of square feet in a house. Be sure to describe the fundamental tasks needed to solve the problem so you can...

Words: 901 - Pages: 4

...readings, participated in the weekly conferences, and thoroughly understand the examples throughout the chapter. There are 3 main components of your submission including: 1. the problem analysis, 2. program design and documentation, and 3. sample test data. 1. Using a similar approach as example 2.3 (textbook page 75): “Finding the Sale Price of Items in a Department Store”, provide your analysis for the following problem statement: You need to write a program that will calculate the number of square feet (living space) in a 4-room house. 1.1. Your analysis should be clearly written and demonstrate your thought process and steps used to analyze the problem. 1.2. Be sure to include what is the required output? 1.3. What is the necessary input and how you will obtain the required output from the given input? 1.4. Also, include your variable names and definitions. 1.5. Be sure to describe the necessary formulas and sample calculations that might be needed. 2. Using a similar approach as the example provided in section 2.2(textbook page 78) for “The Sale Price Program continued”, provide your program design for the program you analyzed for calculating the number of square feet in a house. 2.1. Be sure to describe the fundamental tasks needed to solve the problem so you can use a modular design. 2.2. Provide pseudocode of your overall design that includes the Main module and the order......

Words: 560 - Pages: 3

... 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

...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

...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. Before attempting this exercise, be sure you have completed all of chapter 2 and course module readings, participated in the weekly conferences, and thoroughly understand the examples throughout the chapter. There are 3 main components of your submission including the problem analysis, program design and documentation, and sample test data. 1. Using a similar approach as example 2.3 (textbook page 75): “Finding the Sale Price of Items in a Department Store”, provide your analysis for the following problem statement: You need to write a program that will calculate the number of square feet (living space) in a 4-room house. Your analysis should be clearly written and demonstrate your thought process and steps used to analyze the problem. Be sure to include what is the required output? What is the necessary input and how you will obtain the required output from the given input? Also, include your variable names and definitions. Be sure to describe the necessary formulas and sample calculations that might be needed. 2. Using a similar approach as the example provided in section 2.2(textbook page 78) for “The Sale Price Program continued”, provide your program design for the program you analyzed for calculating the number of square feet......

Words: 518 - Pages: 3

...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. Description: The program first accepts the number of rooms. Then for each room the dimensions are taking (Length and Width). With all the dimensions recorded for each room, Area is calculated as Length by Width, using the formula for area calculation of a rectangle (Length*Width). The final unused area is the sum of all the areas from the number of room specified. Analysis: The number of rooms will be held in a variable N, Length and Width for each room will be held in LN and WN respectively. With N representing the room number. AreaTotal and AreaTemp are used to hold the final area values and the temporal values of area for each room respectively. To keep track of which room’s dimension or area is being dealt with, the variable Count will be used. Variables to use: 1. N : Number of Rooms 2. Count : Count for loop 3. AreaTemp: Temporal area 4. AreaTotal : Total area 5. LN : Length of Room number N 6. WN: Width of Room number N B. Program Design – Following the directions in the assignment, clearly write up your problem design in this section and comment your pseudocode. Pseudo Code: 1. Enter the number of rooms : N 2. Set Count = 0 3. If......

Words: 497 - Pages: 2

...Ten Years in Just 89 Square Feet Jay Shafer and the Tiny House Movement by Antony Taylor For ten years, Jay woke up every morning to his bedroom ceiling, just 3' away from his face. After climbing down from his loft bed into his 6' x 6 ½' living room, he would enter his 4' x 2' bathroom. To most people, Jay would appear to be a prisoner, and the conditions might appear inhumane, yet Jay is not a prisoner, nor has he been forced into these living conditions. In fact, Jay not only chose to live in such a small space, he designed it himself! Jay's house for ten years, the “Epu” is the size of a walk-in closet in most of today's homes, yet it contains a living room, desk, fully functioning kitchen, separate bathroom, and loft bed space. Jay Shafer is the owner of the Tiny Tumbleweed House Company, founder of the Small House Society, an ecological activist, a new-era architect, and a lifestyle revolutionary. His minimalist lifestyle design has been featured in The New York Times, The San Francisco Chronicle, The Wall Street Journal, and Time Magazine. He and his tiny house has been featured on “CNN”, “Oprah”, “This Old House” and countless local news stations. Around the country, people are purchasing his designs, attending his workshops, and following his revolutionary example of how to live life with less space and less possessions, resulting in less of a drain on resources and the environment. A Mixture of Motivations Today's economy suffers in part due...

Words: 1653 - Pages: 7

...Description: This program will calculate the usable area in square feet of a four bedroom house. Analysis: In building this program, I need it to efficiently calculate the total usable area of an entire four bedroom house. In order to do this, the program first needs to calculate the dimensions of each room. Once it has found the total area for each room, the program can then add the four room dimensions to arrive at the total usable area for the entire house. The calculations should look like this: Total usable area = (l*w) + (l*w) + (l*w) + (l*w) Rm. 1 Rm. 2 Rm. 3 Rm. 4 When I first started planning this program, I gave the room variables the names living_room, kitchen, bedroom1, and bedroom2. However, it became confusing trying to match these variables with the names of the dimension variables. Instead, I gave each room a number and the dimension variables have a corresponding number (for example, room1, length1, width1 and room2, length2, width2). Variables: * room1: total usable area of room number one * length1: length of room number one * width1: width of room number one * room2: total usable area of room number two * length2: length of room number two * width2: width of room number two * room3: total usable area of room number three * length3: length of room number three * width3: width of room number three * room4: total usable area of room number four * length4: length of room number......

Words: 905 - Pages: 4

... 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. Before attempting this exercise, be sure you have completed all of chapter 2 and course module readings, participated in the weekly conferences, and thoroughly understand the examples throughout the chapter. There are 3 main components of your submission including the problem analysis, program design and documentation, and sample test data. • 1. Using a similar approach as example 2.3 (textbook page 75): "Finding the Sale Price of Items in a Department Store", provide your analysis for the following problem statement: You need to write a program that will calculate the number of square feet (living space) in a 4-room house. Your analysis should be clearly written and demonstrate your thought process and steps used to analyze the problem. Be sure to include what is the required output? What is the necessary input and how you will obtain the required output from the given input? Also, include your variable names and definitions. Be sure to describe the necessary formulas and sample calculations that might be needed. • 2. Using a similar approach as the example provided in section 2.2(textbook page 78) for "The Sale Price Program continued", provide your programdesign for the program you analyzed for calculating the number of square feet in a house. Be sure to describe the fundamental tasks needed to solve the problem so you can......

Words: 903 - Pages: 4

...1/23/2015 Program Description: The objective of this program is to calculate the square footage of a house with up to 3 rooms. The program will ask the user to enter the width and length of each room in feet. The expected output will multiplying the length and width of each room and then summing the square footage of each room to yield the total square footage of the house. Program name: House Square Footage calculator Analysis: We will use sequential statements All variables will be float We will define these variables: Total_SqFt Room_1_L Room_2_L Room_3_L Room_1_W Room_2_W Room_3_W Input: The user will be prompted to enter the room dimension for each room individually (up to three rooms) “Enter Length and Width of room 1” “Enter Length and Width of room 2” “Enter Length and Width of room 3” Ouput: The output will be defined as the total square footage of the house and will use the input provided by the user to calculate output with this formula: The Square footage of the house will be calculated by this formula: SqFt = (Room_1_L x Room_1_W) + (Room_2_L + Room_2_W) + (Room_3_L x Room_3_W) The output message will display a message “Total Square foot of the house is: SqFt” Test Plan Three test cases will be done 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 | Room1: length=5, width=9; Room 2: length=15, width=20; Room 3: length=6,...

Words: 850 - Pages: 4

...04/01/2012 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 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=......

Words: 643 - Pages: 3

...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...

Words: 801 - Pages: 4

...Running Head: POVERTY IN AMERICA The Effects of Poverty on Millions Americans and New faces of Poverty & Possible Prevention Clara M Jones Strayer University Instructor: Dr. Astiage Tondari Economics of Social Issues ECO405009VA016-1124-001 June 9, 2012 Abstract When a person think of poverty, one simply says’ and or think that individuals, families, groups, and what have you lack financial stability; however, there is so much more that should be considered when it comes to poverty. The World Health Organization has described poverty as the greatest cause of suffering on earth. Living in a state of financial instability is both physically and emotionally damaging, the stress alone can make one ill. Poverty continues to be a problem not only in the United States of America but in developing countries and less developed countries (LDC) worldwide. Some of those countries are under developed countries and developing countries; furthermore, there are major problems in both. The main focus in this paper is on poverty in America; also, the new faces of poverty and how it affects the new faces. . Four Families of Article from USA TODAY, September 28, 2011 The article covers various issues of poverty of different families and individuals; however, the main portion of the article is about a father in Leesburg, Virginia. The man’s name is Billy Schlegel. He is the father of three children; also, he is divorced as of 2004. Billy and his ex-wife share......

Words: 5570 - Pages: 23

...assignment, 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. Before attempting this exercise, be sure you have completed all of chapter 2 and course module readings, participated in the weekly conferences, and thoroughly understand the examples throughout the chapter. There are 3 main components of your submission including the problem analysis, program design and documentation, and sample test data. 1. Using a similar approach as example 2.3 (textbook page 75): “Finding the Sale Price of Items in a Department Store”, provide your analysis for the following problem statement: You need to write a program that will calculate the number of square feet (living space) in a 4-room house. Your analysis should be clearly written and demonstrate your thought process and steps used to analyze the problem. Be sure to include what is the required output? What is the necessary input and how you will obtain the required output from the given input? Also, include your variable names and definitions. Be sure to describe the necessary formulas and sample calculations that might be needed. 2. Using a similar approach as the example provided in section 2.2(textbook page 78) for “The Sale Price Program continued”, provide your program design for the program you analyzed for calculating the number of square feet in a house. Be sure to describe the......

Words: 793 - Pages: 4