我想寫一個程序,當用戶輸入「y」或「是」它會循環。雖然循環在Java
System.out.println("Tuition Wasted Based on Studnet Absences and its effacton GPA");
System.out.println("Enter the number of students to consider: ");
students = keyboard.nextInt();
while (choice == y)
{
if (students >= 1 && students <= 5)
{
for(int i = 0; i < students; i++)
{
System.out.print("\nEnter the student ID for student: ");
studentID = keyboard.nextDouble();
System.out.println("Do you want to run the program again?");
choice = keyboard.nextInt();
}
請幫我每次在Y型或yes我不斷收到錯誤
沒有足夠的信息來幫助:什麼是'choice'?什麼是'y'? - 看起來像「選擇」是一個整數,但你期望它是一個字符? – John3136
同樣是一個studentID是一個奇怪的 –
請給我們的錯誤。可能更多的代碼會很好。 – sdanzig