im having problems with my java homework. I really need help. I need to use a loop make sure what the user input for their grade is vaild the grade has to be between 150 and 0. So can somebody show me the code to use
import java.util.Scanner; // Needed for the Scanner class
/* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Owner
*/
public class SimpleUserCalculation
{
public static void main(String[] args)
{
String input;
String ExpectedGrade;
short TotalPoints;
final char MIN_LETTER_GRADE = 'a';
final char MAX_LETTER_GRADE = 'f';
char letterGrade;
double average;
byte NumOfGrades;
int grade1, grade2, grade3, grade4, grade5;
// Create a Scanner object for keyboard input.
Scanner keyboard = new Scanner(System.in);
// Display general instructions.
System.out.println("What letter grade do you expect to get?");
ExpectedGrade = keyboard.nextLine();
System.out.println("How many grades do you need to enter?");
NumOfGrades = keyboard.nextByte();
System.out.print("Enter Grade #1: ");
grade1 = keyboard.nextInt();
System.out.print("Enter grade #2: ");
grade2 = keyboard.nextInt();
System.out.print("Enter grade #3: ");
grade3 = keyboard.nextInt();
System.out.print("Enter grade #4: ");
grade4 = keyboard.nextInt();
System.out.print("Enter grade #5: ");
grade5 = keyboard.nextInt();
}
}