It's a french class, so you might not understand some words but it doesnt really matter.I will translate some right now. Also we dont use scanner this session because we're new, they developped a thing called "keyboard (Clavier in french)" that takes the input. What is wrong with this code? Its a pizza facturation.
System.out.println("Hi this is a program to take the clients order");
do {
System.out.println("do you want to produce a new bill ? (Y or y = YES, N or n = NO)");
answer = Keyboard.readChar();
while (answer != SMALL_Y && answer!= BIG_Y && answer!= SMALL_N && answer!= BIG_N){
System.out.println("*** INVALID ANSWER");
System.out.println("do you want to produce a new bill ? (Y ou y = YES, N ou n = NO)");
answer= Keyboard.readChar() ;
}
if (answer == SMALL_Y || answer == BIG_Y ){
nbFacture = nbFacture + 1; //thats for the bill number
System.out.println ("What is the client phone number?");
numTel = Keyboard.readString() ;
System.out.println ("What is the client Adress?");
adresseLivraison = Keyboard.readString() ;
System.out.println ("How many meals between 1 and 4 do you plan to order) ");
menu = Keyboard.readInt() ;
}
}while(answer != BIG_N|| answer!= SMALL_N);
I translated everything in english so you can understand the most out of it. The keyboard function is the same as scanner, it's used in order to take the input.
EDIT When I run this code, and select YES. I get this 2 SOP at the same time :What is the client phone number? What is the client Adress?
When I select NO, I get this : do you want to produce a new bill ? (Y or y = YES, N or n = NO) *** INVALID ANSWER do you want to produce a new bill ? (Y or y = YES, N or n = NO)