Bonsoir, j'ai un probleme avec mon code, j'ai voulu test mon switch avant de l'utiliser mais ca ne marche pas normalement je ne comprend pas, voici le code:
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int choice;
do{
System.out.println("Welcome to Amazon Application!");
System.out.println("What do you want to do?\n");
System.out.println("1-Register\n2-Modify profil and personnal info\n3-Search books\n4-Create a shopping cart\n5-Submit an order\n6-Exit");
System.out.println("Please enter your choice:");
choice=input.nextInt();
switch(choice){
case 1: System.out.println("Case 1 test");
break;
default:
break;
}
}while(choice!=6);
System.out.println("Thank you!");
}
}
J'ai voulu essayer seulement le cas 1, mais quand je met en input 1, rien ne se passe, alors que quand je met 6( censé arreter le programme et dire "thank you"), j'ai Case 1 test et than you qui sont affiché !!