Question: Hi, when the user type in the customer name in the below java case block, the customer name doesn't show when display info. of a

Hi, when the user type in the customer name in the below java case block, the customer name doesn't show when display info. of a customer, help with solving that, Thanks! //class Main.java switch (choice) { case 1: { System.out.print("Enter customer unique ssn:"); ssn = sc.nextInt(); System.out.println("Enter customer name:"); String name = sc.nextLine(); 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;

// below class SavingsAccount.java

public void print(String name) { System.out.println("Account number: " + accountNumber); System.out.println("Account holder name: " + name); System.out.println("Balance:" + balance); System.out.println("Account type:"+accountType); System.out.println("Interest rate:"+rate); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!