Free Essay

Program That Will Calculate the Number of Square Feet (Living Space) in a 4-Room House.

In: Computers and Technology

Submitted By pickle
Words 294
Pages 2
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 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 Output

Similar Documents

Free Essay

Area of Usable Room

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

Free Essay

Calculate Square Footage

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

Premium Essay

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

Free Essay

Technology

...Floating Point Numbers”, Pages 57-60) Read Venit, sections 2.1, 2.2, 2.3, 2.4 Read Module 2 sections IV – IX (Skip section V.B (Logical Operators) and V.C (Relational Operators)) Do: Actively participate in conferences and discussions Complete and submit Assignment 1: Data-type, input/output homework This week we are going to study the first chapter concerning Computing History and Computing Ethics, and part from the second chapter – An Introduction to Programming. The tasks for this week are: Read sections 1.4, 1.5 (Skip “Integer Representation” pages 49-53), 1.6 (Skip “Types of Floating Point Numbers”, Pages 57-60) and sections sections 2.1, 2.2, 2.3, 2.4 from Venit; Read the Sections IV – IX (Skip section V.B (Logical Operators) and V.C (Relational Operators)) in the Commentary for Module 2 (follow (Course Content-> Course Resources); Respond by the end of the week to the conference topic related to Base transformation - mandatory online participation; Work and submit the first homework by the end of the week. Requirements and submission options are to be found in the last topic of this conference This week we are going to study the first chapter concerning Computing History and Computing Ethics, and part from the second chapter – An Introduction to Programming. The tasks for this week are: In this 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......

Words: 5124 - Pages: 21

Free Essay

Linneman Re Letter

...Change in Federal Spending since 2008 ($ billions) vs Last 4 Qtrs Change in Federal Receipts since 2008 ($ billions) vs Last 4 Qtrs Comment About previous peak Same as China Now highest in history About inflation 20-year avg = 1.26 million 1.3% 1.3% (only 432,000 SAAR) (only 95,000 SAAR) -4.9% 9.7% -14.3% figure 1 Table of Contents No Double Dip ............................................................................................1 In Memoriam: Ronen Katz ........................................................................2 Where is the Economy Heading? ................................................................4 But What About Jobs?...............................................................................16 The Federal Budget Deficit: Will They Ever Learn? ................................21 The Sinking of Bismarck ..........................................................................24 More Stimulus? No Thanks. .....................................................................25 Financial Reform And Other Jokes ...........................................................27 The Search for Yield: Part II .....................................................................29 Real Estate Capital Markets Are Alive, If Not Quite Well .......................37 Construction Costs ....................................................................................43 Oil Spill Nonsense......

Words: 53759 - Pages: 216

Premium Essay

Hjghhh

...Real Estate Finance F-409 Submitted To Farzana Lalarukh Associate Professor Department of Finance University of Dhaka Submitted By No Name Roll 1. Masud Ahmed 16-014 2. Khaleda Aziz 16-024 3. Akhter-E-Tamanna 16-102 4. Sameya Azad 16-152 5. Mohammad Mominuzzaman Bhuiyan 16-174 Date of Submission: 17-2-14 Date: 17-2-14 Farzana Lalarukh Associate Professor Department of finance University of Dhaka Subject: Submission report on “ Long Run Perspectives of Developer in Bangladesh” Dear Madam, We are pleased to submit the report you have assigned to us. The report paper was to prepare the term paper on the course named “Real Estate Finance” course code: F-409, as a part of our academic activities. Working on this report was a great opportunity for us to apply our theoretical expertise, sharpen our view and ideas. Finally, we are very thankful to you for giving us an effective topic to prepare our report and we are waiting eagerly for any kind of question you may have concerning our report. Sincerely yours On Behalf of our Group ………………………. Sameya Azad This is high time we conveyed our deepest gratitude and sincere submission to the Almighty ALLAH for giving us the opportunity to accomplish such an enjoyable task of preparing this report in time. We express our thanks to our dear course teacher Mrs. Farzana Lalarukh for assigning us a report dealing with the Real estate sector......

Words: 7200 - Pages: 29

Premium Essay

Hhello

...0-13-257637-6 1. Python (Computer program language) I. Title. QA76.73.P98G34 2012 005.13'3—dc22 2011002923 10 9 8 7 6 5 4 3 2 1—EB—14 13 12 11 10 ISBN 10: 0-13-257637-6 ISBN 13: 978-0-13-257637-6 Contents at a Glance Preface xi Chapter 1 Introduction to Computers and Programming 1 Chapter 2 Input, Processing, and Output 31 Chapter 3 Simple Functions 81 Chapter 4 Decision Structures and Boolean Logic 117 Chapter 5 Repetition Structures 157 Chapter 6 Value-Returning Functions and Modules 203 Chapter 7 Files and Exceptions 239 Chapter 8 Lists and Tuples 295 Chapter 9 More About Strings 341 Chapter 10 Dictionaries and Sets 371 Chapter 11 Classes and Object-Oriented Programming 421 Chapter 12 Inheritance 483 Chapter 13 Recursion 509 Chapter 14 GUI Programming 529 Appendix A Installing Python 567 Appendix B Introduction to IDLE 569 Appendix C The ASCII Character Set 577 Appendix D Answers to Checkpoints Index 579 595 v This page intentionally left blank Contents Preface xi Chapter 1 1.1 1.2 1.3 1.4 1.5 Introduction to Computers and Programming Introduction Hardware and Software How Computers Store Data How a Program Works Using Python 1 1 2 8 13 20 Chapter 2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 Input, Processing, and Output Designing a Program Input,......

Words: 76897 - Pages: 308

Free Essay

Student

...III: Market-Sizing Questions CHAPTER 1 AT A GLANCE at a glance Why Case Interviews? • To see your analytical and communication skills • To see how resourceful and creative you can be • To test how you perform under pressure CHAPTER 2 THE INTERVIEW UNPLUGGED Market-Sizing Cases • Test your ability to use numbers • Often lead off longer cases • Show how well you can keep your cool • Can be solved using a few simple rules Case-by-Case Rules for Market-Sizing Questions CHAPTER 5 NAILING THE CASE CHAPTER 4 THE PRACTICE RANGE CHAPTER 3 Market-Sizing Case Rules • Use round numbers • Show your work • Use paper and a calculator 2 W E T F E E T I N S I D ER GUID E CH AP TER 1 AT A GLANCE CH AP TER 2 THE INTERVIEW UNPLUGGED CH AP TER 3 Mark et-Siz ing Ca se R ules CH AP TER 4 THE PRACTICE RANGE CH AP TER 5 NAILING THE CASE 3 WET F EET IN S IDER GUIDE The Interview Unplugged 2 Overview........................................... 6 The WetFeet Way of Cracking a Case Question................. 6 Ace Your Case® III: Market-Sizing Questions CHAPTER 5 NAILING THE CASE CHAPTER 4 THE PRACTICE RANGE CHAPTER 3 Market-Sizing Case Rules CHAPTER 2 THE INTERVIEW UNPLUGGED CHAPTER 1 AT A GLANCE Overview › The best way to prepare for a case interview is to practice. And by reading this book right now, you’re well on your way to mastering the case-interview process. This guide is......

Words: 25729 - Pages: 103

Free Essay

Spa & Wellness Industry

...Elsevier http://www.nckvietnam.com Butterworth-Heinemann is an imprint of Elsevier Linacre House, Jordan Hill, Oxford OX2 8DP, UK 30 Corporate Drive, Suite 400, Burlington, MA01803, USA First edition 2008 Copyright © 2008 Elsevier Ltd. All rights reserved No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means electronic, mechanical, photocopying, recording or otherwise without the prior written permission of the publisher Permissions may be sought directly from Elsevier’s Science & Technology Rights Department in Oxford, UK: phone ( 44) (0) 1865 843830; fax ( 44) (0) 1865 853333; email: permissions@elsevier.com. Alternatively you can submit your request online by visiting the Elsevier web site at http:/ /elsevier.com/locate/permissions, and selecting Obtaining permission to use Elsevier material Notice No responsibility is assumed by the publisher for any injury and/or damage to persons or property as a matter of products liability, negligence or otherwise, or from any use or operation of any methods, products, instructions or ideas contained in the material herein. British Library Cataloguing in Publication Data A catalogue record for this book is available from the British Library Library of Congress Cataloging-in-Publication Data A catalog record for this book is available from the Library of Congress ISBN: 978-0-7506-8464-4 For information on all Butterworth-Heinemann publications visit our web site......

Words: 153860 - Pages: 616

Free Essay

Implementation of Commercial Energy Saving Controls in the Home Environment.

...Implementation of commercial energy saving controls in the home environment. Prepared for: Christopher McCulloch MSTM 4060 Instructor Memorial University of Newfoundland Prepared by: Ray Bursey Student number: 200207546 Due: July 24, 2011 Prepared in partial fulfillment of the requirements of MSTM 4060: Advanced Technical Communications 31 Concord Rd Conception Bay South, NL, A1X 2C1 July 24, 2011 Mr. Christopher McCulloch Instructor, Advanced Technical Communications Marine Institute of Memorial University of Newfoundland PO BOX ??? St. John's, NL, A1C5R3 Dear Mr. McCulloch, In response to your request during April 2011, I have prepared the following report entitled Implementation of Commercial Energy Saving Controls in the Home Environment. As the title of the report suggests, energy saving controls commonly used in the commercial sector are possible and can prove very beneficial. Home automation is a growing field in which research is being conducted at an increasing rate. This report concerning the home automation field makes reference to industry specific and moderately technical terms; therefore to assist with information presented, a glossary has been included in Appendix A. I have enjoyed working on this report and look forward to presenting the findings in the upcoming PowerPoint presentation portion of the course the week of July 25th, 2011. In the meantime, should there be any questions about the report you can contact me...

Words: 5721 - Pages: 23

Free Essay

Aicirteam

...can jump, while the high jump and pole vault are decided on the height achieved.  Combined events, which include the decathlon (typically competed by men) and heptathlon (typically competed by women), are competitions where athletes compete in a number of different track and field events, with each performance going toward a final points tally. Road Running -Road running competitions are running events (predominantly long distance) which are mainly conducted on courses of paved or tarmac roads, although major events often finish on the track of a main stadium. In addition to being a common recreational sport, the elite level of the sport – particularly marathon races – are one of the most popular aspects of athletics. Road racing events can be of virtually any distance, but the most common and well known are the marathon, half marathon, 10 km and 5 km. CROSS-COUNTRY RUNNING Cross country running is the most naturalistic of the sports in athletics as competitions take place on open-air courses over surfaces such as grass, wood land trails, and earth. It is both an individual and team sport, as runners are judged on an individual basis and a point scoring method is used for teams. Competitions are typically long distance races of 4 km (2.5 mi) or more which are usually held in autumn and winter. Cross country's most successful athletes often compete in long-distance track and road events as well. RACEWALKING Race walking is a form of competitive walking that usually......

Words: 43282 - Pages: 174

Free Essay

Gmat

...distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher. 0-07-151120-2 The material in this eBook also appears in the print version of this title: 0-07-149340-9. All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps. McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in corporate training programs. For more information, please contact George Hoare, Special Sales, at george_hoare@mcgraw-hill.com or (212) 904-4069. TERMS OF USE This is a copyrighted work and The McGraw-Hill Companies, Inc. (“McGraw-Hill”) and its licensors reserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill’s prior consent. You may use the work for your own noncommercial and personal use; any other use of the......

Words: 234594 - Pages: 939

Free Essay

Dan Brown

...and monuments in this novel are real. ———————————— Prologue House of the Temple 8:33 P.M. The secret is how to die. Since the beginning of time, the secret had always been how to die. The thirty-four-year-old initiate gazed down at the human skull cradled in his palms. The skull was hollow, like a bowl, filled with bloodred wine. Drink it, he told himself. You have nothing to fear. As was tradition, he had begun this journey adorned in the ritualistic garb of a medieval heretic being led to the gallows, his loose-fitting shirt gaping open to reveal his pale chest, his left pant leg rolled up to the knee, and his right sleeve rolled up to the elbow. Around his neck hung a heavy rope noose—a “cable-tow” as the brethren called it. Tonight, however, like the brethren bearing witness, he was dressed as a master. The assembly of brothers encircling him all were adorned in their full regalia of lambskin aprons, sashes, and white gloves. Around their necks hung ceremonial jewels that glistened like ghostly eyes in the muted light. Many of these men held powerful stations in life, and yet the initiate knew their worldly ranks meant nothing within these walls. Here all men were equals, sworn brothers sharing a mystical bond. As he surveyed the daunting assembly, the initiate wondered who on the outside would ever believe that this collection of men would assemble in one place . . . much less this place. The room looked like a holy sanctuary from the ancient world. The......

Words: 164451 - Pages: 658

Premium Essay

Restaurant Business

...Graphics, Pre-press & DTP Printed by : Published in April 2004 by: Secretary General, Federation of Hotel & Restaurant Associations of India B-82, 8th Floor, Himalaya House, 23 Kasturba Gandhi Marg, New Delhi - 110 001 Phones : (011) 23318781, 23318782, 23322634, 23322647, 23323770 Fax : (011) 23322645 E-Mail : fhrai@vsnl.com Website : www.fhrai.com © Federation of Hotel & Restaurant Associations of India (FHRAI), 2004 Price: One copy free to concerned FHRAI members. (Additional copies at Rs. 400.00 for FHRAI members and Rs.600.00 for Non-Members.) US$50.00 for foreign dispatches 2 Contents Table of Contents 1. 2. 3. Executive Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7 Background Scenario and Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11 Analysis of Questionnaire Responses 3.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 3.2. Trends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 3.3. Financials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 4. 5. 6. 7. 8. Food Trends-At home and abroad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 International......

Words: 28190 - Pages: 113

Premium Essay

Arvind

...Graphics, Pre-press & DTP Printed by : Published in April 2004 by: Secretary General, Federation of Hotel & Restaurant Associations of India B-82, 8th Floor, Himalaya House, 23 Kasturba Gandhi Marg, New Delhi - 110 001 Phones : (011) 23318781, 23318782, 23322634, 23322647, 23323770 Fax : (011) 23322645 E-Mail : fhrai@vsnl.com Website : www.fhrai.com © Federation of Hotel & Restaurant Associations of India (FHRAI), 2004 Price: One copy free to concerned FHRAI members. (Additional copies at Rs. 400.00 for FHRAI members and Rs.600.00 for Non-Members.) US$50.00 for foreign dispatches 2 Contents Table of Contents 1. 2. 3. Executive Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7 Background Scenario and Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11 Analysis of Questionnaire Responses 3.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 3.2. Trends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 3.3. Financials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 4. 5. 6. 7. 8. Food Trends-At home and abroad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 International......

Words: 28190 - Pages: 113