I'm a beginning programmer and am stumped on the last part of this assignment. I can't seem to figure out how to have the Letter Grade show. Here's what I have so far, any help as to where I'm going wrong would be much 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 + "+");
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);
}
}