Registros
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ejemploreload;
/**
*
* @author usuario
*/
import java.io.*;public class Programa {
public static Automovil carros[] = new Automovil [100];
public static int contador = 0;
public static BufferedReader br;
public static voidmain(String[] args) throws Exception{
br = new BufferedReader(
new InputStreamReader (System.in));
System.out.print("DIME TU NOMBRE: ");
Stringnombre = br.readLine();
System.out.println("Bienvenido " + nombre + "!");
int opcion = 0;
while (opcion != 4) {System.out.println("----------------------------- ");
System.out.println("***MENU*** ");
System.out.println("------------------------------");
System.out.println("1. AGREGAR UN AUTOMOVIL.");System.out.println("2. LISTAR AUTOMOVIL");
System.out.println("3. LISTAR AUTOMOVILES POR AÑO");
System.out.println("4. SALIR");System.out.println("----------------------------- ");
System.out.print("SU OPCION ES: ");
opcion = Integer.parseInt(br.readLine());
System.out.println("\tUSTEDSELECCIONO: " + opcion);
switch (opcion) {
case 1:
registrarAutomovil();
break;
case 2:listarAutomoviles();
}
}
}
public static void registrarAutomovil() throws Exception{
Automovil carro = new Automovil();System.out.println("----------------------------- ");
System.out.println("***REGISTRAR AUTOMOVIL*** ");
System.out.println("------------------------------");...
Regístrate para leer el documento completo.