Hi wat's wrong with my "do while" loop it never allows me to enter the grade even if I enter 'A' or 'B' or 'C'..?
import java.util.Scanner;
public class ArraysOfStudentDetails {
public static void main( String [] args )
{
Scanner in = new Scanner( System.in );
final int SIZE = 10;
String[] names = new String[SIZE];
char[] module1 = new char[SIZE];
char[] module2 = new char[SIZE];
char[] module3 = new char[SIZE];
char[] module4 = new char[SIZE];
char[] module5 = new char[SIZE];
int j;
char grade;
String holding;
for( int i = 0; i < SIZE; i ++)
{
j = i + 1;
System.out.println( "Please enter student #" + j +
" details:");
System.out.print( "Enter name for student #" + j );
names[i] = in.nextLine();
do
{
System.out.print( "Enter grade #1" );
holding = in.nextLine();
grade = holding.charAt(0);
}
while( grade != 'A' || grade != 'B' || grade != 'C'
|| grade != 'D' || grade != 'E' );
module1[i] = grade;
do
{
System.out.print( "Enter grade #2" );
holding = in.nextLine();
grade = holding.charAt(0);
}
while( grade != 'A' || grade != 'B' || grade != 'C'
|| grade != 'D' || grade != 'E' );
module2[i] = grade;
do
{
System.out.print( "Enter grade #3" );
holding = in.nextLine();
grade = holding.charAt(0);
}
while( grade != 'A' || grade != 'B' || grade != 'C'
|| grade != 'D' || grade != 'E' );
module3[i] = grade;
do
{
System.out.print( "Enter grade #4" );
holding = in.nextLine();
grade = holding.charAt(0);
}
while( grade != 'A' || grade != 'B' || grade != 'C'
|| grade != 'D' || grade != 'E' );
module4[i] = grade;
do
{
System.out.print( "Enter grade #5" );
holding = in.nextLine();
grade = holding.charAt(0);
}
while( grade != 'A' || grade != 'B' || grade != 'C'
|| grade != 'D' || grade != 'E' );
module5[i] = grade;
System.out.println();
System.out.println();
}
}
}