Menu

[Solved]Java Need Input Mismatch Exception Check Input Input Try Catch Statement Code Public Stati Q37068302

Java Need a Input mismatch exception that will check the inputfor each input with a try catch statement

Here is the code

public static Customer addCustomer() { int cCount = 1; Customer cust = new Customer(cCount++); Scanner scnr = new Scanner(System.in); System.out.println(“Please Enter The Customer’s First Name: “); cust.setFirst(scnr.nextLine()); System.out.println(“Please Enter The Customer’s Last Name: “); cust.setLast(scnr.nextLine()); System.out.println(“Please Enter The Customer’s Phone Number “); cust.setphone(scnr.nextLine()); System.out.println(“Please Enter The Customer’s Buying Preference (New or Used)”); cust.setpreference(scnr.nextLine()); return cust;

Expert Answer


Answer to Java Need a Input mismatch exception that will check the input for each input with a try catch statement Here is the cod… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *