Imag3n
Páginas: 3 (613 palabras)
Publicado: 10 de septiembre de 2010
import java.util.*;
public class Persona
{
String DNI="";
String Nombre="";
String Apellidos="";
String Telefono="";
String Email="";
publicstatic void MostrarPersona(ArrayList <Persona> Contactos)
{
int i=0;
Iterator it = Contactos.iterator();
if (!it.hasNext())
System.out.println("NoHay Contactos en La Agenda."+"\n");
else
while (it.hasNext())
{
it.next();
System.out.println("Entrada Nº" +(i+1) +"\n"+ "Dni: " +Contactos.get(i).DNI +"\n"+
"Nombre: " +Contactos.get(i).Nombre +"\n"+
" " +Contactos.get(i).Apellidos +"\n"+
"Telefono: " +Contactos.get(i).Telefono +"\n"+
"Email: " +Contactos.get(i).Email +"\n\n");
i++;
}
}
public static void AddPersona(ArrayList <Persona> Contactos)
{
Persona Datos;
Datos=new Persona();
Scanner leer = new Scanner(System.in);
System.out.println("Ingrese su DNI: ");
Datos.DNI=leer.nextLine().toUpperCase();
System.out.println("Ingrese su Nombre: ");
Datos.Nombre=leer.nextLine();
System.out.println("Ingrese sus Apellidos: ");
Datos.Apellidos=leer.nextLine();
System.out.println("Ingrese su Telefono: ");
Datos.Telefono=leer.nextLine();
System.out.println("Ingrese su Email: ");
Datos.Email=leer.nextLine();
Contactos.add(Datos);
}
public static voidBuscarPersona(ArrayList <Persona> Contactos)
{
int i=0,j=0;
Scanner leer = new Scanner(System.in);
System.out.println("Ingrese el Dni Para Buscar: ");
String...
Leer documento completo
Regístrate para leer el documento completo.