Generation

generate functionTue, 28 Feb 2023

crea una abm para el nombre y apellido de un cliente.

public static void main (String[] args) { Scanner in = new Scanner(System.in); String name = ""; String surname = ""; String input; String[] split; int option = 0; System.out.println("Hello user. Please enter your name and surname: "); while (true) { input = in.nextLine(); split = input.split(" "); if (isValid(split)) { name = split[0]; surname = split[1]; break; } else { System.out.println("Invalid input, please use following format:\n" + "name surname\n" + "Enter again: "); } } System.out.println("Thank you.\n" + "What would you like to do?\n" + "1. Show name\n" + "2. Show surname\n" + "3. Show full name\n" + "4.

Questions about programming?Chat with your personal AI assistant