センチネルの終了キーを終了するように設定しようとしている下部で問題が発生しています.どのようにそれを行うべきか正確にはわかりません。
int 番号;
do
{
Scanner Input = new Scanner(System.in);
System.out.print("Enter a positive integer or q to quit program:");
number = Input.nextInt();
}
while(number >= 0);
do
{
Scanner Input = new Scanner(System.in);
System.out.print("Input should be positve:");
number = Input.nextInt();
}
while(number < 0);
do
{
Scanner quit = new Scanner(System.in);
System.out.print("Enter a positive integer or quit to end program");
input = quit.nextstring();
}
while (!input.equals(quit))//sentinel value allows user to end program
{
quit = reader.next()