LexarG56

Generation

generate functionFri, 16 Jun 2023

Generar un menú que tenga la opción: Sumar

public class MenuCalculadora { public static void main(String[] args) { int choice; Scanner s = new Scanner(System.in); do { System.out.println("\nMENU: "); System.out.println("1.Suma"); System.out.println("2.Resta"); System.out.println("3.Salir"); System.out.println("Ingrese su opción: "); choice = s.nextInt(); switch (choice) { case 1: System.out.println("Agregar función Suma"); break; case 2: System.out.println("Agregar función Resta"); break; case 3: System.out.println("Salir"); break; default: System.out.println("Opción incorrecta."); } } while (choice != 3); } }

Questions about programming?Chat with your personal AI assistant