Hey all, I'm a beginner programmer and I've been working to find the solution to my issue for a few hours now. What I am trying to do is have the user prompted for his/her name and 5 grades after that. The 5 grades will combine to make a letter grade using the "+" and "-" system. I have the first part done but I am really struggling trying to figure out how to get the appropriate letter grade to coincide with the number grade. This is what I have so far. Any help would be greatly appreciated!!
import java.util.Scanner; public class Lab1 { public static void main (String args []){ Scanner input = new Scanner(System.in); System.out.println("Enter Student's Name "); String studentName = input.nextLine(); System.out.println("Please Enter your Lab Grade, Participation Grade, Test 1 Grade, Test 2 Grade, and Final Exam Grade"); int Labs = input.nextInt(); if (Labs > 56) System.out.println("Error: Your Labs Grade " + Labs + " is too high!"); int Participation = input.nextInt(); if (Participation > 4) System.out.println("Error: Your Participation Grade " + Participation + " is too high!"); int Test1 = input.nextInt(); if (Test1 > 12) System.out.println("Error: Your Test 1 Grade " + Test1 + " is too high!"); int Test2 = input.nextInt(); if (Test2 > 12) System.out.println("Error: Your Test 2 Grade " + Test2 + " is too high!"); int FinalExam = input.nextInt(); if (FinalExam > 16) System.out.println("Error: Your Final Exam Grade " + FinalExam + " is too high!"); int FinalGrade = (Labs + Participation + Test1 + Test2 + FinalExam); if (FinalGrade > 100) System.out.println("Error: Your Final Grade " + FinalGrade + " is too high!"); char LetterGrade; if (FinalGrade >= 97) LetterGrade = 'A' System.out.println("The final grade for " + studentName + "is an " + LetterGrade + "+"); else if (FinalGrade >= 93) LetterGrade = 'A' System.out.println("The final grade for " + studentName + "is an " + LetterGrade); if (FinalGrade >= 90) LetterGrade = 'A'; System.out.println("The final grade for " + studentName + "is an " + LetterGrade + "-"); if (FinalGrade >= 87) LetterGrade = 'B'; System.out.println("The final grade for " + studentName + "is a " + LetterGrade + "+"); if (FinalGrade >= 83) LetterGrade = 'B'; System.out.println("The final grade for " + studentName + "is a " + LetterGrade); if (FinalGrade >= 80) LetterGrade = 'B'; System.out.println("The final grade for " + studentName + "is a " + LetterGrade + "-"); if (FinalGrade >= 77) LetterGrade = 'C'; System.out.println("The final grade for " + studentName + "is a " + LetterGrade + "+"); if (FinalGrade >= 73) LetterGrade = 'C'; System.out.println("The final grade for " + studentName + "is a " + LetterGrade); if (FinalGrade >= 70) LetterGrade = 'C'; System.out.println("The final grade for " + studentName + "is a " + LetterGrade + "-"); if (FinalGrade >= 60) LetterGrade = 'D'; System.out.println("The final grade for " + studentName + "is a " + LetterGrade); if (FinalGrade <= 59) LetterGrade = 'F'; System.out.println("The final grade for " + studentName + "is an " + LetterGrade); } }