Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 13:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
public class myGradeCalc3{
public static void main(String[] args){
final int NUMBER_OF_STUDENTS = 10;
int[] grades = new int[NUMBER_OF_STUDENTS];
System.out.println("Welcome to the grade calculator, this program will can calculate the gradepoint average of "+NUMBER_OF_STUDENTS+" students.");
Scanner in = new Scanner(;
//Enter the students grades
for(int i =0;i<NUMBER_OF_STUDENTS;i++){
System.out.println("Please Enter Grade "+i+":");
grades[i]= in.nextInt();
int sum =0;
for(int i =0;i<NUMBER_OF_STUDENTS;i++){
int average = sum / NUMBER_OF_STUDENTS;
System.out.println("The grade point average of the whole class is " + average );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment