I wrote a java application that coverts number grades to letter grades. Here is what it looks like:
/java application to That corresponds the letter grade with the number grade import java.util.Scanner; //program uses the class scanner public class gradescore{ //main method begins execution of java application public static void main(String args[]){ Scanner input=new Scanner(System.in); int grade; System.out.printf("Entered the numbered grade you received"); grade=input.nextInt(); if(70>=grade>=60) System.out.println("Your grade is a D"); //java code tells you that your letter grade is a D if you input a score that is between 60 and 70 if(80>=grade>=70) System.out.println("You received a C letter grade");//java code tells you that your letter grade is a C if you input a score that is between and includes 70 and 80 if(90>=grade>=80) System.out.println("You received a B letter grade");//java code tells you that your letter grade is a B if you input a score that is between and includes 90 and 80 if(100>=grade>=90) System.out.println("You received an A letter grade");//java code tells you that your letter grade is a A if you input a score that is between and includes 100 and 90 if(60>grade) System.out.println("You received an F letter grade"); //java code tells you that your letter grade is an F is you input a score that is below 60 }//end method }//end class gradescore
Here are the errors that are displayed with I attempt to compile the code.
What is wrong with my code?C:\Users\Courtney\Desktop\gradescore.java:31: error: '(' expected
if
^
C:\Users\Courtney\Desktop\gradescore.java:33: error: illegal start of expression
}//end method
^
C:\Users\Courtney\Desktop\gradescore.java:33: error: ')' expected
}//end method
^
C:\Users\Courtney\Desktop\gradescore.java:35: error: illegal start of statement
C:\Users\Courtney\Desktop\gradescore.java:34: error: reached end of file while parsing
}//end class gradescore
^
5 errors
Tool completed with exit code 1