JcGaming

Act6 -Grading System Full Source Code by Quieta,John Carl

Oct 18th, 2022 (edited)
1,168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.80 KB | Source Code | 0 0
  1. //Activity Week 6 by John Carl Quieta
  2.  
  3. /**
  4.  * gradingsystemquieta
  5.  */
  6. public class gradingsystemquieta {
  7.  
  8.     public static void main(String[] args) {
  9.         // My Name
  10.         String StudentName = "John Carl Quieta's Average Grade is: ";
  11.         // Grade description
  12.  
  13.         String exc = " Excellent";
  14.         String vg = " Very Good";
  15.         String gd = " Good";
  16.         String satf = " Satisfactory";
  17.         String pd = " Passed";
  18.         String fd = " Failed";
  19.  
  20.         // Total grades of activities
  21.         int compiler = 100;
  22.         int activity = 100;
  23.         int assignment = 30;
  24.         int activityweek4 = 100;
  25.         int JNotes = 100;
  26.  
  27.         int totalgrades = compiler + activity + assignment + activityweek4 + JNotes;
  28.  
  29.         // My Grade
  30.  
  31.         int Scompiler = 100;
  32.         int Sactivity = 100;
  33.         int Sassignment = 30;
  34.         int Sactivityweek4 = 100;
  35.         int SJNotes = 100;
  36.  
  37.         int SGradeTotal = Scompiler + Sactivity + Sassignment + Sactivityweek4 + SJNotes;
  38.  
  39.         // Grade Equivalent and Numerical Value
  40.  
  41.         float G1 = 1.00f; // 96% to 100%
  42.         float G2 = 1.25f; // 90% to 95%
  43.         float G3 = 1.50f; // 85% to 89%
  44.         float G4 = 1.75f; // 80% to 84%
  45.         float G5 = 2.00f; // 75% to 79%
  46.         float G6 = 2.25f; // 70% to 74%
  47.         float G7 = 2.50f; // 65% to 69%
  48.         float G8 = 2.75f; // 60% to 64%
  49.         float G9 = 3.00f; // 51 to 59%
  50.         float G10 = 5.00f; // 0% to 50%
  51.  
  52.         if (SGradeTotal == totalgrades || SGradeTotal > 412.8) {
  53.             System.out.println(StudentName + String.format("%.02f", G1) + exc);
  54.         } else if (SGradeTotal >= 387) {
  55.             System.out.println(StudentName + String.format("%.02f", G2) + exc);
  56.         } else if (SGradeTotal >= 365.5) {
  57.             System.out.println(StudentName + String.format("%.02f", G3) + vg);
  58.         } else if (SGradeTotal >= 344) {
  59.             System.out.println(StudentName + String.format("%.02f", G4) + vg);
  60.         } else if (SGradeTotal >= 322) {
  61.             System.out.println(StudentName + String.format("%.02f", G5) + gd);
  62.         } else if (SGradeTotal >= 301) {
  63.             System.out.println(StudentName + String.format("%.02f", G6) + gd);
  64.         } else if (SGradeTotal >= 279.5) {
  65.             System.out.println(StudentName + String.format("%.02f", G7) + satf);
  66.         } else if (SGradeTotal >= 258) {
  67.             System.out.println(StudentName + String.format("%.02f", G8) + satf);
  68.         } else if (SGradeTotal >= 219.3) {
  69.             System.out.println(StudentName + String.format("%.02f", G9) + pd);
  70.         } else if (SGradeTotal >= 0) {
  71.             System.out.println(StudentName + String.format("%.02f", G10) + fd);
  72.         }
  73.         // my output should be 1.00
  74.     }
  75.  
  76. }
  77. // Submitted by: John Carl Quieta
  78. // October 18, 2022
Advertisement
Add Comment
Please, Sign In to add comment