0% found this document useful (0 votes)
152 views3 pages

Java Student Grade

This Java program calculates a student's average grade based on their quiz, project, attendance, and exam scores. It prompts the user to input the student's name and each grade component. It then calculates the average and prints a summary including the student's name, individual grades, total average, and a remark on whether they passed or failed.

Uploaded by

Joann Galopo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
152 views3 pages

Java Student Grade

This Java program calculates a student's average grade based on their quiz, project, attendance, and exam scores. It prompts the user to input the student's name and each grade component. It then calculates the average and prints a summary including the student's name, individual grades, total average, and a remark on whether they passed or failed.

Uploaded by

Joann Galopo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

package activity5grade; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.

IOException; /** * * @author user */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { BufferedReader dataIn = new BufferedReader (new InputStreamReader (System.in)); String fname = ""; String String String String float float float float wquiz = ""; wproject = ""; wattendance = ""; wexam = ""; quiz = 0; project = 0; attendance = 0; exam = 0;

double average = 0; System.out.println("________________STUDENT GRADE_______________________ "); System.out.println(); System.out.print("Please Enter Student Name : "); try { fname= dataIn.readLine (); } catch(IOException e) { System.out.println("Error"); }

System.out.print("Please enter grade for PROJECT try { wproject= dataIn.readLine (); } catch(IOException e) { System.out.println("Error"); } System.out.print("Please enter grade for QUIZZES try { wquiz= dataIn.readLine (); } catch(IOException e) {

: ");

: ");

System.out.println("Error"); }

System.out.print("Please enter grade for ATTENDANCE : "); try { wattendance= dataIn.readLine (); } catch(IOException e) { System.out.println("Error"); } System.out.print("Please enter grade for FINAL EXAM : "); try { wexam= dataIn.readLine (); } catch(IOException e) { System.out.println("Error"); } quiz = Integer.parseInt(wquiz); project = Integer.parseInt(wproject); attendance = Integer.parseInt(wattendance); exam = Integer.parseInt(wexam); average = (quiz+attendance+exam+project)/4; System.out.println(); System.out.println("________________SUMMARY OF GRADES________________ __"); System.out.println("\t\tQUIZ: System.out.println("\t\tPROJECT: System.out.println("\t\tATTENDANCE: System.out.println("\t\tEXAM: "+quiz); "+project); "+attendance); "+exam);

System.out.println("================================================= =="); System.out.println(); System.out.println("\t\tSTUDENT NAME: "+fname); System.out.println("\t\t\t"); System.out.println("\t\tTOTAL GRADE : "+average); System.out.println("\t\t\t"); if ((average>=75) && (average<=100)){ System.out.println("\t\tREMARKS: Congratulations you PASSED!"); } else{ System.out.println("\t\tREMARKS: Sorry, you FAILED!"); } System.out.println(); System.out.println("================================================ ===");

} }

You might also like