I'm having some trouble with my loop here, I want the user to be able to add more info(the grade and credits) if they have more classes to add. I'm stuck and hoping someone can help. Thanks.
import java.util.*;
public class DoWhileDemo
{
public static void main(String[] args){
String name;
String add;
double gradePoints = 0;
double credits = 0;
Scanner input = new Scanner(System.in);
System.out.println("Enter Students Name: ");
name = input.nextLine();
do {
System.out.println("Enter class credits: ");
credits = input.nextDouble();
System.out.println("Enter letter grade: ");
gradePoints = input.nextDouble();
System.out.println("Add another class? (Y/N) ");
add = input.nextLine();
} while (add == ("Y"));
}
}