+ 1

Java introduction/ System for bank clients/ block

Hi! Please check my code for this task as The Ai coupdn't sugget anz new and it seem it fulfils the req. still 1st test case is wrong: switch(number){ case 1: System.out.println("Langauge selection"); break; case 2: System.out.println("Customer support"); break; case 3: System.out.println("Check the balance"); break; case 0: System.out.println("Exit"); break; } } while(number!=0); } }

12th Dec 2023, 2:39 PM
Attila Takács
Attila Takács - avatar
9 Antworten
+ 3
Could you tell me what exactly the code is supposed to do and what the input data was in 1 test? Since I don’t have a pro subscription, I can’t view this task, it’s quite difficult to say what exactly is wrong.
12th Dec 2023, 3:27 PM
Buterbrod:)
Buterbrod:) - avatar
+ 3
There seems to be a do while loop, but „do“ at beginning of this code is forgotten.
12th Dec 2023, 5:45 PM
JaScript
JaScript - avatar
+ 3
case 1: System.out.println("Langauge selection"); // you misspelled the word "language" correctly "langUage" but not "langAuge"
12th Dec 2023, 9:32 PM
Buterbrod:)
Buterbrod:) - avatar
+ 1
Thanks a lot. I couldn't even imagine that it was beacuse if the spelling. I was looking for tha cause in the code for a week now....
12th Dec 2023, 9:37 PM
Attila Takács
Attila Takács - avatar
+ 1
الرجاء عدم إرسال بريد عشوائي لمنتدى الأسئلة والأجوبة ادم محمد الصالح
17th Dec 2023, 7:51 PM
BroFar
BroFar - avatar
0
import java.util.Scanner; class Demo{ public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int number; do { number = scanner.nextInt(); /* output corresponding message 1 => Language selection 2 => Customer support 3 => Check the balance 0 => Exit */ switch(number){ case 1: System.out.println("Langauge selection"); break; case 2: System.out.println("Customer support"); break; case 3: System.out.println("Check the balance"); break; case 0: System.out.println("Exit"); break; default: System.out.println("input is invalid"); break; } } while(number!=0); } }
12th Dec 2023, 9:27 PM
Attila Takács
Attila Takács - avatar
0
This is the full code! I'd really appricate if you could help.
12th Dec 2023, 9:28 PM
Attila Takács
Attila Takács - avatar
0
An the task is: "System for bank clients You are creating an automated phone system for bank clients. Number selections should activate the actions noted below as follows: • 1 => Language selection • 2 => Customer support • 3 => Check account balance • 0 => Exit You can use the first 3 commands in a random sequence without interrupting the phone call - only the number 0 interrupts it. The given code takes numbers continuously. Task: Complete the code to output the corresponding messages, until the client enters 0. Sample Input: 1 3 0 Sample Output: Language selection Check the balance Exit"
12th Dec 2023, 9:30 PM
Attila Takács
Attila Takács - avatar