Package asd.
import java.util.Scanner;
Public class pay {
Public static void main (String [] args) {
Scanner kk=new Scanner (System. In);
String a="y";
While (a! {
="n")System. The out. Println (" * * * * * * * * * * * * * * * * * * more credit * * * * * * * * * * * * * * * * * * ");
System. The out. Println (" please enter the phone number: ");
String number=kk. Next ();
System. The out. Println (" 1.10 yuan \ \ t3.30 t2.20 yuan yuan \ \ t5.100 n4.50 yuan yuan \ t6 other amount ");
System. The out. Println (" serial number: please select a payment amount ");
Int. No=kk nextInt ();
The switch (no) {
Case 1: System. Out.println (" mobile phone number: "+ number +", 10 yuan more credit!" ); break;
Case 2: System. Out.println (" mobile phone number: "+ number +", more credit 20 yuan!" ); break;
Case 3: System. Out.println (" mobile phone number: "+ number +", more credit 30 yuan!" ); break;
Case 4: System. Out.println (" mobile phone number: "+ number +", more credit $50!" ); break;
Case 5: System. Out.println (" mobile phone number: "+ number +", 100 yuan more credit!" ); break;
Case 6: System. Out. Println (" input amount of money: "); Double money=kk. NextDouble ();
System. Out.println (" mobile phone number: + number + ", "more credit" + money + "yuan!" ); break; }
System. Out.println (" whether to continue top-up (top-up, please enter y; No prepaid phone, please input n) : ");
A=kk. Next ();
}
System. The out. Println (" * * * * * * * * * * * * * * * * * * * * * * * * * * thank you for your help * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ");
}
}
CodePudding user response:
You didn't write out processing
A=kk. Next ();
No processing code later
CodePudding user response:
Because y never equal to n
CodePudding user response: