Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C program to display the names of 5 states as shown below, identified with numbers 1-5. 1. Ohio 2.Illinois 3.Maryland 4.California 5.Florida Follow

Write a C program to display the names of 5 states as shown below, identified with numbers 1-5.

1. Ohio

2.Illinois

3.Maryland

4.California

5.Florida

Follow the steps below to read populations of the 5 states, find the average population of the states, and print the average population.

1.Request a number between 1 and 5. If the entered number is not between 1 and 5, repeat this step until a valid number is entered.

2.Prompt the user for the population of the state, which should be between 1 million to 15 million. If the entered population is outside the range, repeat this step until a valid population is entered.

3. If the population of a state is entered more than once, use the last entered population.

4.Use a while loop to read valid populations for all 5 states. Then, find the average population of the states and display the average population.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions

Question

6. What is moral hazard? How do banks reduce this problem? LOP8

Answered: 1 week ago

Question

3-4. What are the three attributes of quality information? [LO3]

Answered: 1 week ago

Question

In the US, drug companies receive a patent of

Answered: 1 week ago