Question

For problems provide: 1. inputs: any value needed by your algorithm must be provided through an...

For problems provide:

1. inputs: any value needed by your algorithm must be provided through an input

2. outputs

3. error conditions

4. an algorithm using pseudocode

5. a set of test cases

Apartment complex census [40 points]

Suppose the management of an apartment complex would like to know the demographics of the people living in the complex, more specifically the number of seniors, adults and children. Write an algorithm that will record the number of seniors, adults, and children in each apartment in the apartment complex, and then display the total number of seniors, the total number of adults, and the total number of children in the complex, as well as the average number of each (seniors, adults, and children) per apartment.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

STEP 1: CONSIDER THE TOTAL NUMBER OF APARTMENTS IN THE COMPLEX.

STEP2: CATEGORIZE THE AGES OF ALL THE PEOPLE INTO PARTS i.e;

CATEGORY AGE

1. CHILDREN   age should be (0-17)

2. ADULTS age should be (18-59)

3.SENIORS age should be (60 and above)

STEP3: FIRST GIVE A NUMERICAL VALUE THAT - FOR HOW MANY NUMBER OF PERSONS YOU WANT TO CALCULATE AND CATEGORIZE THERE AGE.(INDIVIDUALLY IN EACH APARTMENT)

STEP4: YOU CAN WRITE THE CONDITION LIKE THIS

if(age>=0 && age<=17)

child++;

else if(age>17 && age<=59)

adults++;

else

seniors++;

BY THIS STEP YOU CAN CALCULATE TOTAL HOW MANY NUMBER OF PEOPLE ARE THERE IN EACH AND EVERY CATEGORY.

STEP5: BASED ON EVERY CATEGORIZED VALUE.. WE CAN CALCULATE THE AVERAGE BASED ON TOTAL NO.OF PEOPLE IN EACH APARTMENT FROM WHOLE COMPLEX.

Add a comment
Know the answer?
Add Answer to:
For problems provide: 1. inputs: any value needed by your algorithm must be provided through an...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Instructions For each of the following 4 problems provide 1. inputs 2. outputs 3. error conditions...

    Instructions For each of the following 4 problems provide 1. inputs 2. outputs 3. error conditions 4. an algorithm using pseudocode 5. the minimum and the maximum number of operations 6. a set of test cases 1. Multiplication Compute and display the result of how much a certain number of pounds of apple costs. 2. Gas Compute and display the price a person will pay for gas at the gas station. If the person pays with a credit card, there...

  • 3. WCS111 FM. Suppose you work at WCS111 FM, a radio station by computer scientists for...

    3. WCS111 FM. Suppose you work at WCS111 FM, a radio station by computer scientists for computer scientists. The station runs a contest where listeners win prizes based on how many hours they spend programming in Java. When a listener calls in to the radio station, the listener will state how many hours (whole number) a month he/she spends programming in Java. Based on the number of hours spent programming, display the listener prize according to the following rules: 1....

  • Based on, “75 Must Know Statistics about Long-Term Care,” Please discuss four conclusions you can come...

    Based on, “75 Must Know Statistics about Long-Term Care,” Please discuss four conclusions you can come to for the problems that the long term care industry will face in the coming decade. You must include statistics from the article. 75 Must-Know Statistics About Long-Term Care Christine Benz 31 Aug 2017 In my years of speaking to groups of retirees and pre-retirees, I've learned that there are a handful of topics that will send an event completely out of my control....

  • Business Law: Text and Cases 14th Edition Please answer Number 3 I already have questions 1...

    Business Law: Text and Cases 14th Edition Please answer Number 3 I already have questions 1 and 2 answered. 1)   Assume you are the attorney for the Landlord. List the legal grounds under which you would sue the Tenants and list the arguments you would use to persuade the Judge to rule in your favor. Also list the defenses you would raise to the counterclaim brought by Tenants. Support your answers with legal reasoning and conclusions. The lease was for...

  • STEP 1: In your own words define problem employees and the categories they may fall into....

    STEP 1: In your own words define problem employees and the categories they may fall into. For the second or last paragraph provide your opinion on which employee type is the most difficult. DEFINITION : I think that "problem employees" are employees that either directly or indirectly hinder the organization's mission or vision, and break down into roughly four categories. In general, problem employees can be classified into two broad categories - employees creating problems for the organization and employees...

  • St. Francis Assisted Living Facility St. Francis Medical Center, a 450 bed rehabilitation non-profit hospital began...

    St. Francis Assisted Living Facility St. Francis Medical Center, a 450 bed rehabilitation non-profit hospital began to see a significant decline in admissions. St. Francis' mission focuses on inpatient and outpatient rehabilitation of the severely injured and catastrophically ill. While the patient census varied from month to month, it appeared to the St. Francis Board of Trustees that the inpatient population was slowly but steadily declining. The hospital's market researchers reported that fewer people were being severely injured due to...

  • QUESTION 1: Why must project manager should have good technical skills but also good management skills?...

    QUESTION 1: Why must project manager should have good technical skills but also good management skills? QUESTION 2: **Communication and Communicator are related" This quote from the text suppose that the communication process is lead by the spokeperson. Do you think is it a gift" to be a good communicator or a skill to improve ( use example of your knowledge to answer)? QUESTION 3: Look at the text paragraph yellow highlighted, and do you think that in today's world...

  • You need not run Python programs on a computer in solving the following problems. Place your...

    You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...

  • Article Summary I Read the article below and provide feedback by writing a 2 page summary....

    Article Summary I Read the article below and provide feedback by writing a 2 page summary. Please write in essay format (you may include the questions but the response should be in essay format) Must include the following information Title of the article Author(s) of the article Reference list (include the article itself and any other reference material such as another article that is cited in your summary). Use the reference list in the article to get information about another...

  • 10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated...

    10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated sludge operation that adversely affect effluent quality with origins in the engineering, hydraulic and microbiological components of the process. The real "heart" of the activated sludge system is the development and maintenance of a mixed microbial culture (activated sludge) that treats wastewater and which can be managed. One definition of a wastewater treatment plant operator is a "bug farmer", one who controls the aeration...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT