Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that gets a list of grades from the user and counts the number of grades above the average grade. Begin your program

Write a program that gets a list of grades from the user and counts the number of grades above the average grade.

Begin your program by asking the user to enter the number of grades. Store this value in a variable called numOfGrades. If the number is a negative number or zero, you program should print some message and stop.

Next, create an array of size numOfGrades. Then you will read numOfGrades values representing student grades from the keyboard and place them into the array.

Next, find the average grade of all the values entered, and print this value to the screen.

Finally, count the grades that are above the average grade. Display each individual grade that is above the average grade, and display the count of such grades.

For example:

Please enter the number of grades: 4

Enter a grade: 80

Enter a grade: 65

Enter a grade: 78

Enter a grade: 90

The average grade is: 78.25

The grades above the average grade are:

80

90

for a total of 2 grades

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

Databases Organizing Information Digital And Information Literacy

Authors: Greg Roza

1st Edition

1448805929, 978-1448805921

More Books

Students also viewed these Databases questions

Question

3. How has e-commerce transformed marketing?

Answered: 1 week ago