Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

  1. Write a java 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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions