Premium Essay

Area Calculator in C

In: Computers and Technology

Submitted By papaotres
Words 595
Pages 3
Jesse Sabatini
CMIS 102 6387 Introduction to Problem Solving and Algorithm Design (2158)
Professor Anyanso, Chukwuma
Due: 30 Aug 2015

The following program that I created was in the language of C. I used the online free compiler found at https://ideone.com/DRQIBZ in order to make sure that everything in the coding worked properly. The purpose of the script is to calculate the area of 4 individual rooms and ultimately get an output with the over all usable area. The thought process behind my code was first under the assumption that all four rooms in the house were either a square or rectangular in shape. With that in mind, and also the fact that I have never written anything other than Hello, World!, I researched multiple ways to create an “area of a rectangle or square” C language algorithm and experimented with what worked best for me. Once I figured out a little more about how the syntax worked, I then added the necessary variables in order to allow for the calculations of multiple rooms. Once I established the formulas to create the correct output, I then added the variable for the overall total and introduced the proper equation needed to give said total. Although I will also have a table below containing the variable data, making it more organized, I must note that with the IDEONE compiler I had to hit return after every number input representing each dimension necessary to complete the syntax and get the proper outputs. I will also provide an example of the format used for the inputs used in order to get the proper outcome below the table.

|Test Case # |Input Variables |Expected Output |
|1 |Room 1; L = 10 , W = 10

Similar Documents

Free Essay

Science Physics

...mathematics, and you want to give them something simple and friendly to read. Preferably something that gets right to the point and which costs no more than the paper it’s printed on. I didn’t know where I could get a document like this, so I wrote one. You’ll notice that “significant figures” have not been rigidly observed in the numerical examples. That’s because this book is directed at students who need help in getting any correct numbers to round off. If you find this booklet to be useful or else worth exactly what it costs and/or have any suggestions, please write to me at murdock@tntech.edu To the Students: Your college science courses may very well require you to do some mathematics (algebra, trig) and some work with a scientific calculator. You may not have been warned about this when you wrote that check for your tuition, but it’s too late now! Bwaahh-hah-Haah! . i ii PREFACE! In this booklet I’ve tried to pick out the bits of your math courses that you will really need to get through your first courses in physics and chemistry. In addition, I give some directions on...

Words: 12710 - Pages: 51

Free Essay

Pensacola Surgery Centers: Time Value Analysis

...Where there are concepts not covered in the text or the undergraduate lecture, I have explained them to you in ‘What You Need to Know' for Week Three. I have also made notes for each question, and they are listed below.   1. a. and b. templates can be found in the case model. c. and d. require you to use a formula to manually calculate the effective interest rate; you can find the formula in the Week Three Time Value Analysis document. Once this is done, you can use the case model to find the future values. Finally, e. is a bonus question (one point); the only hint I can give you is that you must equate the effective interest rates formulas and solve for the unknown. A. $55,000.00 B. 5% = $52,500.00 15% = $57,500.00 C.   2. a. and b. can be found in the case model. c. and d. require you to use the effective interest rates calculated in question 1 above. Then you can use the case model to find the future values.   3. Templates for both a. and b. are in the model.   4. a. Refer to the model for guidance. b. and c. can be solved using the model. d. and e. will require that you use a financial calculator, given the complexity of the problems. There are several calculators on the internet. (See the Web Sites section of this site.) The key inputs are: interest rate, future value, number of annual payments, and amount of each payment. f. is another bonus opportunity (one point). For this bonus question, you have to make an assumption that, under annual compounding...

Words: 436 - Pages: 2

Free Essay

Nononoilldie

...Ma KEY STAGE 3 TIER 5–7 2004 Mathematics test Paper 1 Calculator not allowed Please read this page, but do not open your booklet until your teacher tells you to start. Write your name and the name of your school in the spaces below. First name Last name School Remember ■ The test is 1 hour long. ■ You must not use a calculator for any question in this test. ■ You will need: pen, pencil, rubber and a ruler. ■ Some formulae you might need are on page 3. ■ This test starts with easier questions. ■ Try to answer all the questions. ■ Write all your answers and working on the test paper – do not use any rough paper. Marks may be awarded for working. ■ Check your work carefully. ■ Ask your teacher if you are not sure what to do. For marker’s use only QCA/04/1199 Total marks BLANK PAGE KS3/04/Ma/Tier 5–7/P1 2 Instructions Answers This means write down your answer or show your working and write down your answer. Calculators You must not use a calculator to answer any question in this test. Formulae You might need to use these formulae Trapezium Area = 1 (a + b)h 2 Prism Volume = area of cross-section t length KS3/04/Ma/Tier 5–7/P1 3 Points of intersection 1. The diagram shows two straight lines. Where the lines cross is called a point of intersection. (a) Draw three straight lines that have only one point of intersection. 1 mark (b)...

Words: 1689 - Pages: 7

Free Essay

Mathematics B Unit 1 Paper March 2012

...Statistics and Probability (Calculator) Higher Tier Friday 2 March 2012 – Afternoon Time: 1 hour 15 minutes Paper Reference 5MB1H/01 Total Marks You must have: Ruler graduated in centimetres and millimetres, protractor, pair of compasses, pen, HB pencil, eraser, calculator. Tracing paper may be used. Instructions Use black ink or ball-point pen. Fill in the boxes at the top of this page with your name, centre number and candidate number. Answer all questions. Answer the questions in the spaces provided – there may be more space than you need. Calculators may be used. If your calculator does not have a button, take the value of to be 3.142 unless the question instructs otherwise. Information The total mark for this paper is 60 The marks for each question are shown in brackets – use this as a guide as to how much time to spend on each question. Questions labelled with an asterisk (*) are ones where the quality of your written communication will be assessed. Advice Read each question carefully before you start to answer it. Keep an eye on the time. Try to answer every question. Check your answers if you have time at the end. Turn over P40619A ©2012 Pearson Education Ltd. *P40619A0120* 6/6/6/3 GCSE Mathematics 2MB01 Formulae: Higher Tier You must not write on this formulae page. Anything you write on this formulae page will gain NO credit. 1 Area of trapezium = 2 (a + b)h a cross section Volume of prism = area of cross section × length ...

Words: 1448 - Pages: 6

Premium Essay

Examples Of Observation In Middle School

...H.E. McCracken is a Middle School that temporally houses 9th graders as a new high school is being built in Beaufort County school District. During my day of observation I had the pleasure to observe three different special education classes: a math resource class, self-contained math class and inclusion math class. As the first semester winnows down these 9th graders are preparing for their End of Course (EOC) exams on their Dell tablets for testing in the areas of math and ELA. Students that do not pass their EOC will have a 9th grade status but will be moved to the new high school and take 10th grade classes for the rest of their classes. In Ms. Castrisis (affectionately known as Ms. C) Resource class, students began with a 12 question...

Words: 495 - Pages: 2

Premium Essay

Cost Analysis

...Project Proposal: Local Grind To Hootman Investing PM592 – Summer 2011 Executive Summary When you think of coffee in the Northwest, most people know there is Starbucks and small coffee shops. Coffee shops have become a familiar feature of American communities, not only for the purchase of a morning cup of coffee and snacks, but for mid-day and evening as well. With the introduction of fancy espresso-based coffee and drinks, people are spending between $3 and $6 for their cappuccino, mocha latte, vanilla ice blended drink, or other flavored drink that may be coffee based. Privately owned coffee houses have been on the increase for over 20 years because they are relatively recession proof. Leading companies, such as Starbucks and Peet’s, are located in almost every major city in the US. Small unique coffee shops like the Local Grind are able to compete with these larger chains; they are able to develop competitive advantages by catering to the specific demographics of their location and by personalizing their services to cater local needs. Our goal is to provide quality coffee related services and products by capitalizing on an untapped demographic that has many potential un-serviced customer. To accomplish our goals, we are requesting $100,000 from your company, as an initial investment to set up operations. We plan to invest an additional 20% from our own resources, up front, for the start up operational costs. Local Grind is scheduled to open for business...

Words: 2572 - Pages: 11

Premium Essay

General Maths Preliminary

...Project of Student Name:……………………………… | Teacher: ……………………….. | Task No: 3 | Date Due: Continuous Final: Week 3, Term 3, 27th July 2015 | Topic: Assessment on Mathematics and Driving FSDr1 Costs of purchase and insurance FSDr2 Running costs and depreciation | Marks: Part A -Report (40%) Part B- In class Assessment Task (60%) | Weighting: 20 % | Outcomes to be assessed: MGP-1 uses mathematics and statistics to compare alternative solutions to contextual problems MGP-2 represents information in symbolic, graphical and tabular form MGP-3 represents the relationships between changing quantities in algebraic and graphical form MGP-5 demonstrates awareness of issues in practical measurement, including accuracy, and the choice of relevant units MGP-6 models financial situations relevant to the student’s current life using appropriate tools MGP-7 determines an appropriate form of organisation and representation of collected data MGP-8 performs simple calculations in relation to the likelihood of familiar events MGP-9 uses appropriate technology to organise information from a limited range of practical and everyday contexts MGP-10 justifies a response to a given problem using appropriate mathematical terminology. | Buying a car Candice is 24 years old, single and lives in Orange, New...

Words: 1996 - Pages: 8

Premium Essay

Avon in Global Market in 2009: Managing and Developing a Global Workforce

...Version 3 Duration: Two hrs preceded by a 10 minute reading period. Supervisor will indicate when answering of exam may begin. If you wish to make notes, please use the back of your exam paper, or on the edge columns. Instructions: Answer all five questions in the space provided on this paper. Total Marks: 60 Aids to be supplied by the University: None Aids to be supplied by the Student: One A4 sheet of paper hand- or type written on both sides. Text book by Keller [any edition; need not be clean] Calculator: As approved by the School THIS IS A RESTRICTED BOOK EXAM Mobile phones or any other devices capable of communicating information are prohibited from use during examinations. Electronic Organizers / PDAs or any other similar devices capable of storing text or other restricted information are prohibited. Calculators – if the use of a calculator in the exam is allowed, only calculators specifically approved by the school may be used. The examiner will check for compliance prior to the commencement of the exam. Any breaches of this policy will be considered cheating and appropriate action will be taken as per University policy PLEASE FILL IN YOUR DETAILS BELOW: FAMILY NAME _________________________ GIVEN NAMES _________________________ STUDENT ID ___________________________ Page 1 of 6 QUESTION 1 (12 marks) a) In a city where 30% of the people own their own homes...

Words: 1183 - Pages: 5

Free Essay

Sample Exam

...day by ASQ, complete with the same instructions that are provided on exam day. The test questions that appear in this sample examination are retired from the CSSBB pool and have appeared in past CSSBB examinations. Since they are now available to the public, they will NOT appear in future SSBB examinations. This sample examination WILL NOT be allowed into the exam room. Appendix A contains the answers to the sample test questions. ASQ will not provide scoring and analysis for this sample examination. Remember: These test questions will not appear on future examinations so your performance on this sample examination may not reflect how you perform on the formal examination. A self-appraisal of how well you know the content for the specific areas of the body of knowledge (BOK) can be completed by using the worksheet in Appendix B. On page 2 of the instructions, it states “There are 150 questions on this 4-hour examination.” Please note that this sample exam only contains 75 questions. If you have any questions regarding this sample examination, please email cert@asq.org © 2009 ASQ ASQ grants permission for individuals to use this sample examination as a means to prepare for the formal examination. This examination may be printed, reproduced and used for non-commercial, personal or educational purposes only, provided that (i) the examination is not modified, and (ii) ASQ’s copyright notice is included. The user assumes all risks of copyright infringement. THIS PAGE WAS LEFT...

Words: 4541 - Pages: 19

Premium Essay

Case Study on Mini Hydro Power Plant & a Tea Factory

...period from the project is even or uneven. In case they are even, the formula to calculate payback period is: Payback Period = | Initial Investment | | Cash Inflow per Period | When cash inflows are uneven, we need to calculate the cumulative net cash flow for each period and then use the following formula for payback period: Payback Period = A + | B | | C | In the above formula, A is the last period with a negative cumulative cash flow; B is the absolute value of cumulative cash flow at the end of the period A; C is the total cash flow during the period after A Both of the above situations are applied in the following examples. Decision Rule Accept the project only if its payback period is LESS than the target payback period. Examples Example 1: Even Cash Flows Company C is planning to undertake a project requiring initial investment of $105 million. The project is expected to generate $25 million per year for 7 years. Calculate the payback period of the project. Solution Payback Period = Initial Investment ÷ Annual Cash Flow = $105M ÷ $25M = 4.2 years Example 2: Uneven Cash Flows Company C is planning to undertake another project requiring initial investment of $50 million and is expected to generate $10 million in Year 1, $13 million in Year 2, $16 million...

Words: 2091 - Pages: 9

Premium Essay

Pm592 Course Project 1

...Project Proposal: Local Grind To Investors Investing PM592 – Summer 2011 Executive Summary When you think of coffee in the Northwest, most people know there is Starbucks and small coffee shops. Coffee shops have become a familiar feature of American communities, not only for the purchase of a morning cup of coffee and snacks, but for mid-day and evening as well. With the introduction of fancy espresso-based coffee and drinks, people are spending between $3 and $6 for their cappuccino, mocha latte, vanilla ice blended drink, or other flavored drink that may be coffee based. Privately owned coffee houses have been on the increase for over 20 years because they are relatively recession proof. Leading companies, such as Starbucks and Peet’s, are located in almost every major city in the US. Small unique coffee shops like the Local Grind are able to compete with these larger chains; they are able to develop competitive advantages by catering to the specific demographics of their location and by personalizing their services to cater local needs. Our goal is to provide quality coffee related services and products by capitalizing on an untapped demographic that has many potential un-serviced customer. To accomplish our goals, we are requesting $100,000 from your company, as an initial investment to set up operations. We plan to invest an additional 20% from our own resources, up front, for the start up operational costs. Local Grind is scheduled to open for business...

Words: 2591 - Pages: 11

Premium Essay

Marketing

...attention. Required Textbook/Resources 1. Textbook: FINANCE 2nd edition Cornett, Adair, Nofsinger McGraw-Hill Irwin 2014 ISBN 978-0-07- 803481-7 2. Access card: Connect/LearnSmart (available from CSU bookstore or on-line at www.mhhe.com/canM2e) 3. Financial calculator, recommended HP 12C 4. Skype Account Prerequisites: ACCT 211 (Accounting II) with a C or higher, COINS 209 (or preferably COINS 211) with a C or higher. If you have not met these requirements, please contact the instructor immediately. You will need intermediate proficiency in Excel to do well in this class. Course Description: This course deals with the principles of capital management within corporations. Topics include the time value of money, valuation concepts, capital budgeting, project cash flow analysis, cost of capital and capital structure. Forecasting, planning and control, specifically financial statement analysis, as well as working capital management are also covered. Faith Integration: As a Christian university, CSU is committed to the development of a Christian worldview grounded in a personal relationship with Christ and dedicated to applying the truth of scripture in all areas of life, personal and professional. Opportunities for faith integration will be pursued. Glorify God: “So...

Words: 3431 - Pages: 14

Free Essay

How to Use Cas

...Appendix: TI-Nspire CAS Operating system Written for operating system OS3. Keystroke actions and short cuts for the TI-Nspire CAS Clickpad (grey) : removes menus and dialogue boxes + : undo last move + : redo last move Home page (icon display) : displays icon page to select applications, mode, My Documents and start a new document : move to next entry box (field) + : switch applications in split screen : options for each application + : contextual menus (same as right mouse click) : accesses secondary (blue) commands + : displays page sorter + : displays previous page + : displays next page : backspace – deletes a character + : clear – clears an entry line : mouse pointer (cursor), selects items + : grab + + : degree sign (°) : fraction template : shift key : display lists of stored variables + : store command ( ) : completes commands and displays results ISBN: 9781107655904 © Peter Jones, Michael Evans, Kay Lipson 2012 Photocopying is restricted under law and this material must not be transferred to another party 788 Cambridge University Press Appendix: TI-Nspire CAS 789 Keystroke actions and short cuts for the TI-Nspire CAS Touchpad (black) : removes menus and dialogue boxes : undo last move + : redo last move + : move to next entry box (field) : switch applications + in split screen Nav Pad (touch pad) : accesses secondary (yellow) commands + : displays page sorter + : displays previous page + : displays next page Home page...

Words: 1897 - Pages: 8

Free Essay

Environmental Science

...Reducing My Environmental Footprint Kaplan University SC225-02 Environmental Science Professor Christina Kamnikar Prepared by: Using the carbon footprint calculator was a very interesting beginning to this assignment. Learning what your footprint is makes it “real” seeing actual numbers related to what you do helps to understand the footprint. After all this is not something we can go outside and see every day, being the invisible mysterious object that countries, politicians and even climate scientist have a hard time defining and identifying the causes and solutions. Plugging in the numbers to the calculator and seeing the results for mine was surprising. The U.S. average is 42,957 and my household with two adults and two cars came out to 26,086. Now I must point out that at this time being unemployed has a benefit to the environment. I have very limited mileage on my Jeep the last year and a half, so that helped my household numbers a lot. We recently purchased a new refrigerator that is energy star approved and that replaced one that was twenty years old. Mother Nature made us replace our furnace a few years ago. We had a flood that left 4.5 feet of water in the basement and causing us to have to replace our oil burning furnace and hot water source. Again it was over twenty years old and we have already seen a huge savings in fuel bills and with the new furnace I am sure a reduction in our carbon footprint. We live in a rural section and you have...

Words: 720 - Pages: 3

Premium Essay

Literature

...w w ap eP m e tr .X w om .c s er UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS International General Certificate of Secondary Education 0580/04, 0581/04 MATHEMATICS May/June 2007 Paper 4 (Extended) 2 hours 30 minutes Additional Materials: *5128615949* Answer Booklet/Paper Electronic calculator Geometrical instruments Graph paper (2 sheets) Mathematical tables (optional) Tracing paper (optional) READ THESE INSTRUCTIONS FIRST If you have been given an Answer Booklet, follow the instructions on the front cover of the Booklet. Write your Centre number, candidate number and name on all the work you hand in. Write in dark blue or black pen. You may use a pencil for any diagrams or graphs. Do not use staples, paper clips, highlighters, glue or correction fluid. Answer all questions. All working must be clearly shown. It should be done on the same sheet as the rest of the answer. Marks will be given for working which shows that you know how to solve the problem even if you get the answer wrong. Electronic calculators should be used. If the degree of accuracy is not specified in the question, and if the answer is not exact, give the answer to three significant figures. Give answers in degrees to one decimal place. For π use either your calculator value or 3.142. At the end of the examination, fasten all your work securely together. The number of marks is given in brackets [ ] at the end of each question or part...

Words: 1220 - Pages: 5