Skip to content

Instantly share code, notes, and snippets.

@Apo45ty
Created April 3, 2014 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Apo45ty/9963255 to your computer and use it in GitHub Desktop.
Save Apo45ty/9963255 to your computer and use it in GitHub Desktop.
public class myGradeCalc{
public static void main(String[] args){
System.out.println("Welcome to the grade calculator, this program will can calculate the gradepoint average of 3 students.");
Scanner in = new Scanner(System.in);
System.out.println("Please Enter Grade 1:");
int grade1 = in.nextInt();
System.out.println("Please Enter Grade 2:");
int grade2 = in.nextInt();
System.out.println("Please Enter Grade 3:");
int grade3 = in.nextInt();
int sum = grade1 + grade2 + grade3;
int average = sum / 3;
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