0% found this document useful (0 votes)
246 views

Grading System in Java

The document contains source code for a Java program that takes in 3 quiz grades as user input, calculates the average, and outputs the average, pass/fail status, and remarks based on the average. It prompts the user to enter grades for 3 quizzes, calculates the average, and uses if/else statements to determine and print the status and remarks based on the average falling within different ranges.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
246 views

Grading System in Java

The document contains source code for a Java program that takes in 3 quiz grades as user input, calculates the average, and outputs the average, pass/fail status, and remarks based on the average. It prompts the user to enter grades for 3 quizzes, calculates the average, and uses if/else statements to determine and print the status and remarks based on the average falling within different ranges.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Name: Luis Clarence Casuga Section: BSIT-1A

SOURCE CODE
package gradingsystem.main;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {

Scanner grade= new Scanner(System.in);


//first grade
System.out.print("Enter a grade in Quiz #1: ");
double firstGrade = grade.nextDouble();

//second grade
System.out.print("Enter a grade in Quiz #2: ");
double secondGrade = grade.nextDouble();

//third grade
System.out.print("Enter a grade in Quiz #3: ");
double thirdGrade = grade.nextDouble();

grade.close();

double average = (firstGrade+secondGrade+thirdGrade)/3;


if (average>=86){
System.out.println("Average : "+average);
System.out.println("Status : Passed");
System.out.println("Remarks : Advanced");
}
else if (average>=75) {
System.out.println("Average : "+average);
System.out.println("Status : Passed");
System.out.println("Remarks : Average");
}
else if (average >= 60) {
System.out.println("Average : "+average);
System.out.println("Status : Failed");
System.out.println("Remarks : Fair");
}
else {
System.out.println("Average : "+average);
System.out.println("Status : Failed");
System.out.println("Remarks : Poor");

}
}
OUTPUT

You might also like