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

can anyone helps me with this java program: Create a LetterGrades program with s

ID: 3857808 • Letter: C

Question

can anyone helps me with this java program:

Create a LetterGrades program with static method findLetterGrade.   The method takes a numeric grade and returns the corresponding letter grade.

      public static String findLetterGrade(double grade)

Here are the corresponding letter grades:
93-100 A 90-92 A-

87-89 B+ 83-86 B 80-82 B-

77-79 C+ 70-76 C

67-69 D+ 63-66 D 60-62 D-

0-59 F

In main you must prompt for a grade (0-100), call the findLetterGrade method and then display the letter grade returned by the method. Use a sentinel-controlled while loop that will repeat until the user enters -1.

ALL input and output must be done in main. Use the command prompt window (terminal) for input and output.

Sample program run:

Enter a grade (0-100) or -1 to quit: 88.5
The letter grade is for 88.50 is B+

Enter a grade (0-100) or -1 to quit: 92.9
The letter grade is for 92.90 is A-

Enter a grade (0-100) or -1 to quit: 74
The letter grade is for 74.00 is C

Enter a grade (0-100) or -1 to quit: -1

Programmed by Your Full Name

Explanation / Answer

package chegg;

import java.util.Scanner;

public class LetterGrades {

/*public static String findLetterGrade(double score){

String lettrGrade = "";

int quotient = (int)score/10; //quotient will deterimine LetterGrade

int remainder = (int)score%10; // remainder will determine if a "+ or -"

switch(quotient){//switch statement for cases if grade is A, B, C, D, F

case 10://100% so just return A+;

return "A+";

case 9: //90-89 is a A

lettrGrade="A";

break;

case 8: //80-89 is a B

lettrGrade = "C";

break;

case 7: //70-79 is a C

lettrGrade="C";

break;

case 6: //60-69 is a D :

lettrGrade = "D";

break;

default:

return "F";

}

switch (remainder){ //remainder switch statement will be used to

//determine if a + or a - is added to the letter grade.

//these are the cases that will receive "+"

case 0: case 1: case 2: case 3: case 4:

lettrGrade+="-";

break;

case 7: case 8: case 9:

lettrGrade +="+";

}

return lettrGrade;//letter grade with final + or _

}*/

public static String findLetterGrade(double scoreval){

String grade=null;

int score = (int) scoreval;

if(scoreval >= 93 && scoreval <=100)

return grade="A";

if(scoreval >= 90 && scoreval <=92)

return grade="A-";

if(scoreval >= 87 && scoreval <=89)

return grade="B+";

if(scoreval >= 83 && scoreval <=86)

return grade="B";

if(scoreval >= 80 && scoreval <=82)

return grade="B-";

if(scoreval >= 77 && scoreval <=79)

return grade="C+";

if(scoreval >= 70 && scoreval <=76)

return grade="C";

if(scoreval >= 67 && scoreval <=69)

return grade="D+";

if(scoreval >= 63 && scoreval <=66)

return grade="D";

if(scoreval >= 60 && scoreval <=62)

return grade="D-";

if(scoreval >= 0 && scoreval <=59)

return grade="F";

return null;

}

public static void main(String[] args) {

double input=0;

String grade = null ;

do{

Scanner scan = new Scanner(System.in);

System.out.print("Enter a grade (0-100) or -1 to quit : ");

input = (double) scan.nextInt();

LetterGrades obj = new LetterGrades();

if(input !=-1){

grade = findLetterGrade(input);

System.out.println("The letter grade is for "+ input +" is "+ grade );

}

}while(input != -1);

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote