Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write the program in C++ with the proper indentation: 1. Declares a whole number type constant value space called MAX_ITEMS and Stores the value of

write the program in C++ with the proper indentation:

1. Declares a whole number type constant value space called MAX_ITEMS and Stores the value of 10

2. Declares an array that can store MAX_ITEMS number of names as string values

3. Declares an array that can store MAX_ITEMS number of ages as numeric values

4. Declares decimal variable spaces for storing total and average age values

5. Using a for repetition structure that runs MAX_ITEMS number of times,

a) prompts the user to input a persons name by using the prompt Enter a name: on the screen, for example: after the user entered the input, for example, bob: (enter a name: bob)

b) Reads the users inputted name from the keyboard and stores it in the array variable created for user-inputted names

c) prompts the user to input that persons age by name using the prompt Enters age: on the screen, for example: enter bob's age

d) Reads the users inputted value from the keyboard and stores it in the variable created for user-inputted ages

6. Using another repetition structure that runs MAX_ITEMS number of times, Retrieves the persons age from the ages array and Adds it to the total

7. After finding the total age of all the persons, Calculates the average age and Stores it in the variable average

8. Using another repetition structure that runs MAX_ITEMS number of times, Retrieves the persons name from the names array, and age from the ages array and Displays it as the output on the screen

9.Needs to output the total and average age values and Displays them as outputs on the screen with proper labels

output should display :

image text in transcribed

Name Carson Total 477 Average 79.5 Letter Grade C

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

Inference Control In Statistical Databases From Theory To Practice Lncs 2316

Authors: Josep Domingo-Ferrer

2002nd Edition

3540436146, 978-3540436140

More Books

Students also viewed these Databases questions

Question

4. I can tell when team members dont mean what they say.

Answered: 1 week ago