Basic Java Coding class. What am I missing?

I am completely new to coding of any kind really and I am taking a programming concepts class for my online university. We are coding java, more specifically Working with Conditionals and Loops. It is a very straight forward attempt at inputting 3 grades and having the code average them and print what the letter grade is based upon the average that is calculated. I can only get the system to print my name and nothing below it. Like I said I am completely new and feel rather dumb for asking something as simple as this but I will add what I have coded here in hopes I can learn what my mistake is. I am typing it again as we are using a server within the class and due to my new status in the forums I cannot simply upload the document I have saved.

import static java.lang.System.out;
public class TestAverages {

public static void main(String args) {

double TestScore1;
double TestScore2;
double TestScore3;
Scanner Keyboard = new Scanner(System.in);
System.out.print(“John Burris:”);
String name1 = Keyboard.nextLine();
System.out.println(“95”);
TestScore1 = Keyboard.nextInt();
System.out.println(“80”);
TestScore2 = Keyboard.nextInt();
System.out.println(“88”);
TestScore3 = Keyboard.nextInt();
double average = ((TestScore1 + TestScore2 + TestScore3)/3);
out.println(name1);
out.println("The average of the 3 test is: " + average;
if (average>=90)
{
System.out.println(“You got an A”);
}
else if (average>=80
{
System.out.println(“You got a B”);
}
else if (average>=70)
{
System.out.println(“You got a C”);
}
else if (average>=60)
{
System.out.println(“You got a D”);
}
else if (average<60)
{
System.out.println(“You got an F”);
}
}
}

2 Likes

problem could be here ?
i think what you want is

System.out.println(name1);
System.out.println("The average of the 3 test is: " + average);

make sure you close every (.
else if (average>=80 is also missing a).

3 Likes