Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Activity Week 6 by John Carl Quieta
- /**
- * gradingsystemquieta
- */
- public class gradingsystemquieta {
- public static void main(String[] args) {
- // My Name
- String StudentName = "John Carl Quieta's Average Grade is: ";
- // Grade description
- String exc = " Excellent";
- String vg = " Very Good";
- String gd = " Good";
- String satf = " Satisfactory";
- String pd = " Passed";
- String fd = " Failed";
- // Total grades of activities
- int compiler = 100;
- int activity = 100;
- int assignment = 30;
- int activityweek4 = 100;
- int JNotes = 100;
- int totalgrades = compiler + activity + assignment + activityweek4 + JNotes;
- // My Grade
- int Scompiler = 100;
- int Sactivity = 100;
- int Sassignment = 30;
- int Sactivityweek4 = 100;
- int SJNotes = 100;
- int SGradeTotal = Scompiler + Sactivity + Sassignment + Sactivityweek4 + SJNotes;
- // Grade Equivalent and Numerical Value
- float G1 = 1.00f; // 96% to 100%
- float G2 = 1.25f; // 90% to 95%
- float G3 = 1.50f; // 85% to 89%
- float G4 = 1.75f; // 80% to 84%
- float G5 = 2.00f; // 75% to 79%
- float G6 = 2.25f; // 70% to 74%
- float G7 = 2.50f; // 65% to 69%
- float G8 = 2.75f; // 60% to 64%
- float G9 = 3.00f; // 51 to 59%
- float G10 = 5.00f; // 0% to 50%
- if (SGradeTotal == totalgrades || SGradeTotal > 412.8) {
- System.out.println(StudentName + String.format("%.02f", G1) + exc);
- } else if (SGradeTotal >= 387) {
- System.out.println(StudentName + String.format("%.02f", G2) + exc);
- } else if (SGradeTotal >= 365.5) {
- System.out.println(StudentName + String.format("%.02f", G3) + vg);
- } else if (SGradeTotal >= 344) {
- System.out.println(StudentName + String.format("%.02f", G4) + vg);
- } else if (SGradeTotal >= 322) {
- System.out.println(StudentName + String.format("%.02f", G5) + gd);
- } else if (SGradeTotal >= 301) {
- System.out.println(StudentName + String.format("%.02f", G6) + gd);
- } else if (SGradeTotal >= 279.5) {
- System.out.println(StudentName + String.format("%.02f", G7) + satf);
- } else if (SGradeTotal >= 258) {
- System.out.println(StudentName + String.format("%.02f", G8) + satf);
- } else if (SGradeTotal >= 219.3) {
- System.out.println(StudentName + String.format("%.02f", G9) + pd);
- } else if (SGradeTotal >= 0) {
- System.out.println(StudentName + String.format("%.02f", G10) + fd);
- }
- // my output should be 1.00
- }
- }
- // Submitted by: John Carl Quieta
- // October 18, 2022
Advertisement
Add Comment
Please, Sign In to add comment