Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This is my code to calculate grades for 2 \"classes\", everything works fine...

ID: 3795273 • Letter: T

Question

This is my code to calculate grades for 2 "classes", everything works fine... BUT I need to be able to print the average of the grade along with its corresponding letter, such as a 90-100 A, 80-89 B, 70-79 C, 60-69 D, 0-59 F. The average grade prints out already I just need to print it with a letter grade too. What do i need to add? Ive tried everything I know..

*The exact question says..

In addition , each numerical grade for CS1301 and CS1101 should be mapped to a letter grade with the following rules:

A: 90-100%

B: 80-89%

C: 70-79%

D: 60-69%

F: 0-59%

* Also, is there a loop i can do so that each time the user finished an if else statement it takes them back to the menu?

import java.util.Scanner; 6 public class iGrade { public static void main (String [] args) i option ); 10 public static void option ) f 13 14 15 16 int choice; i nt ca l cu l ate 1 301 Grades = 1 ; int calculate!101Grades = 2; int exitIGrade3 int maxNum = 0; int gradedExams = 0; 18 20 21 nt grade = 0; int gradedQuizzesHW = 0; int gradedClassEngag = (); int exams'Total0; int quizzesHwTotal = 0; int classkngage'otal int gradedLabs0 int gradedLabPart = 0; int LabsTotal-O int LabPartTota1 = 0; 23 24 25 26 28 29 30 3 1 32 double exams D = 0; double guizzesHwD = (); double classEngageD = 0; double averageGrade13010; 3 4 35 36 37 38 39 4 0 41 42 43 double labsPartD = 0; double averageGrade1101 0; Scanner keyboard - new Scanner (System.in); 45 4 6 M7 48 4 9 50 Scanner scnr = new Scanner (System.in) ; System.out.println("Welcome to iGrade!!"); System.out.printin ("Please enter your name") string fullName = scnr . nexlLine();

Explanation / Answer

1st Correction

CODE TO BE ADDED BETWEEN LINES 108 and 109

String letterGrade = "" ;

if(averageGrade1301>=90 && averageGrade1301<=100)

letterGrade = "A";

else if(averageGrade1301>=80 && averageGrade1301<=89)

letterGrade = "B";

else if(averageGrade1301>=70 && averageGrade1301<=79)

letterGrade = "C";

else if(averageGrade1301>=60 && averageGrade1301<=69)

letterGrade = "D";

else

letterGrade = "F";

replace line 110 with below statement

System.out.println("Hey " + fullName + ",your average grade is " + averageGrade1301 + " "+letterGrade);

2nd Correction

BELOW CODE TO BE ADDED AFTER THE LINE averageGrade1101=(LabTotal + LabPartTotal) / 2

String letterGrade = "" ;

if(averageGrade1101>=90 && averageGrade1101<=100)

letterGrade = "A";

else if(averageGrade1101>=80 && averageGrade1101<=89)

letterGrade = "B";

else if(averageGrade1101>=70 && averageGrade1101<=79)

letterGrade = "C";

else if(averageGrade1101>=60 && averageGrade1101<=69)

letterGrade = "D";

else

letterGrade = "F";

now, after adding above lines, replace the next line with below statement

System.out.println("Hey " + fullName + ",your average grade is " + averageGrade1101 + " "+letterGrade);

Enclose the body part of if(choice==1) with below code

while(choice==1)

{

//Put the body statements of choice ==1 here

//At last line of while body put another line i.e., choice=keyboard.nextInt();

}

Know me if you have any doubt and dont forget to give your precious rating....

Request Note - Please try to post the codes in text format instead of images. Thanks.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote