Java program to average grades

Write a function that accepts the "number of grades" from the user and returns the average of the grades entered by the user.

How many grades: 5
Enter the grade 1: 80.54
Enter the grade 2: 96.34
Enter the grade 3: 78.45
The average is 84.666664