package loopcode;
import java.util.Scanner;
/** * * @author SClough */ public class Loopcode {
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
int userinput;
do{
System.out.print("Please enter a number between 1 and 10; ");
userinput = scanner.nextInt();
if ((userinput <= 1 || userinput >= 10 )); {
System.err.print("The number you entered was not between 1 and 10!");
}
else{
System.out.print("Good job! The number you enterred is " + userinput +".");
}
}while (userinput <= 1 || userinput >= 10 );
}
Aucun commentaire:
Enregistrer un commentaire