This program is for java. Write a program that finds the average of a set of grades The main file grades.java will ask the user to input how many grades they are going to enter, then create an array of the appropriate size. The user will then be prompted to enter the grades. You will then have a class file calculations.java that will have a method that accepts the array as a parameter and calculates the average. The main program should then print a line that says “The average of your (number of grades) is (calculated averaged printed with only 2 decimal places)” The grade inputs should be ints and the average should be a double. Make sure to take account of any error situations, like trying to enter a negative grade. The number of grades entered must be greater than 0.
This
Write a program that finds the average of a set of grades
The main file grades.java will ask the user to input how many grades they are going to enter, then create an array of the appropriate size. The user will then be prompted to enter the grades.
You will then have a class file calculations.java that will have a method that accepts the array as a parameter and calculates the average.
The main program should then print a line that says
“The average of your (number of grades) is (calculated averaged printed with only 2 decimal places)”
The grade inputs should be ints and the average should be a double.
Make sure to take account of any error situations, like trying to enter a negative grade. The number of grades entered must be greater than 0.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images