This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class myGradeCalc2{ | |
public static void main(String[] args){ | |
System.out.println("Welcome to the grade calculator, this program will can calculate the gradepoint average of 4 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(); | |
System.out.println("Please Enter Grade 4:"); | |
int grade4 = in.nextInt(); | |
int sum = grade1 + grade2 + grade3 + grade4; | |
int average = sum / 4; | |
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