Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class sistema {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- // int adulto = 18;
- //PREGUNTAS
- System.out.print("Nombre: ");
- String nombre = scanner.nextLine();
- System.out.print("Primer Apellido: ");
- String apellido1 = scanner.nextLine();
- System.out.print("Segundo Apellido: ");
- String apellido2 = scanner.nextLine();
- System.out.print("Edad: ");
- int edad = Integer.parseInt(scanner.nextLine());
- System.out.print("Pais: ");
- String pais = scanner.nextLine();
- System.out.print("Ciudad: ");
- String ciudad = scanner.nextLine();
- System.out.print("Calle: ");
- String calle = scanner.nextLine();
- System.out.print("Numero: ");
- String numero = scanner.nextLine();
- System.out.print("Telefono: ");
- String telefono = scanner.nextLine();
- System.out.print("Correo: ");
- String correo = scanner.nextLine();
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("Bienvenido, " + nombre + " " + apellido1 + " " + apellido2);
- System.out.println("¿Que quieres hacer?");
- System.out.println("1. Revisar tus datos");
- System.out.println("2. Editar tus datos");
- System.out.println("3. Salir");
- System.out.print("---> ");
- int opcion = Integer.parseInt(scanner.nextLine());
- System.out.println("");
- System.out.println("");
- System.out.println("");
- //OPERACION
- do {
- switch (opcion) {
- case 1:
- System.out.println("Usuario: " + nombre + " " + apellido1 + " " + apellido2);
- System.out.println("Direccion: " + calle + ", " + numero + " (" + ciudad + ", " + pais + ")");
- System.out.println("Contacto: ");
- System.out.println(" - Telefono: " + telefono);
- System.out.println(" - Correo: " + correo);
- System.out.println("");
- System.out.println("");
- System.out.println("");
- break;
- case 2 :
- System.out.print("Nombre: ");
- nombre = scanner.nextLine();
- System.out.print("Primer apellido: ");
- apellido1 = scanner.nextLine();
- System.out.print("Segundo apellido: ");
- apellido2 = scanner.nextLine();
- System.out.print("Edad: ");
- edad = Integer.parseInt(scanner.nextLine());
- System.out.print("Pais: ");
- pais = scanner.nextLine();
- System.out.print("Ciudad: ");
- ciudad = scanner.nextLine();
- System.out.print("Calle: ");
- calle = scanner.nextLine();
- System.out.print("Numero: ");
- numero = scanner.nextLine();
- System.out.print("Telefono: ");
- telefono = scanner.nextLine();
- System.out.print("Correo: ");
- correo = scanner.nextLine();
- System.out.print("Tus datos han sido cambiados, " + nombre);
- break;
- //case 3:
- //case 4:
- // ...
- }
- System.out.println("");
- System.out.println("");
- System.out.println("");
- System.out.println("Hola, " + nombre + " " + apellido1 + " " + apellido2);
- System.out.println("¿Que quieres hacer?");
- System.out.println("1. Revisar tus datos");
- System.out.println("2. Editar tus datos");
- System.out.println("3. Salir");
- System.out.print("---> ");
- opcion = Integer.parseInt(scanner.nextLine());
- }
- while (opcion < 3);
- //repite estos comandos hasta que la variable "opcion" sea igual o mayor a 3
- }
- }
- /*
- ACTUALIZACIONES:
- - Hacer la interfaz más visual
- - Poner más opciones
- - Verificacion de campos
- - Error al ser menor de edad
- - Base de datos de usuarios
- - Acceder a otros ficheros con permisos y usuarios
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement