Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi, When the user type in ssn, it jumps over the possibility for the user to type in the customer name. Need help to correct
Hi, When the user type in ssn, it jumps over the possibility for the user to type in the customer name. Need help to correct that in the below Java code in switch case 1? Or is the problem in another class? Thanks! //below code part of Main.java class. switch (choice) { case 1: { System.out.print("Enter customer unique ssn:"); ssn = sc.nextInt(); System.out.println("Enter customer name:"); String name = sc.nextLine(); Customer customer = new Customer(ssn, name); //Customer customer = new CustomerBuilder().setSsn(ssn).setName(name).createCustomer(); Bank.addCustomer(customer); System.out.println(" Customer added successfully with uniquely ssn:"+customer.getSSN()); } break;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started