Software">
Practica3 p60
Practica3 p60
Practica3 p60
Politécnica Salesiana
Carrera: CIENCIAS DE LA COMPUTACION
Nivel: 3ERO
Asignatura: PROGRAMACION APLICADA
Grupo: 1
Resultados de
Aprendizaje:
Indicador de logro:
Práctica Número: 3
Horas Dedicadas: 5
DESCRIPCIÓN DE LA PRÁCTICA:
Analice las clases creadas en la práctica e identifique cuales son los atributos y métodos, y construya el
diagrama de clases con sus correspondientes clases.
//Insertar el diagrama de clases
1.1 En base al diagrama de clases generado, construir la aplicación en Eclipse utilizando Herencia
CLASE: libro
private String ISBN;
private String autor;
private String nombreL;
private String year;
public libros() {
}
public libros(String ISBN_, String autor_, String nombreL_, String
year_) {
this.ISBN=ISBN_;
this.autor=autor_;
this.nombreL=nombreL_;
this.year=year_;
}
private ArrayList<libros>lb;
Scanner leer=new Scanner(System.in);
public biblioteca() {
lb=new ArrayList<libros>();
}
}
} while (op != 2);
1.2 Generar una clase ejecutable que cumpla con los siguientes requisitos planteados en el problema:
Clase: ejecutable Capturas de Pantalla con cada opción ejecutada
public static void main(String[] args) {
// TODO Auto-generated
method stub
Scanner leer=new
Scanner(System.in);
libros lib= new libros();
biblioteca biblio=new
biblioteca();
while(true) {
System.out.println("*********
BIBLIOTECA CENTENARIO **********");
System.out.println("1) Ingresar un
libro");
System.out.println("3) Prestar un
libro");
System.out.println("4) Devolver un
libro");
System.out.println("0) Salir");
System.out.println("Ingrese su
opcion: ");
op=leer.nextInt();
if(op==1) {
System.out.println("Ingrese el
ISBN: ");
ISBN=leer.next();
System.out.println("Ingrese el
autor:");
autor=leer.next();
System.out.println("Ingrese el
nombre del libro:");
nombreL=leer.next();
System.out.println("Ingrese el
anio: ");
year=leer.next();
biblio.Add(new
libros(ISBN, autor, nombreL, year));
System.out.println("OPERACION
EXITOSA :)");
Lib_disp++;
}
else if(op==2) {
System.out.println("LISTA DE
LIBROS DE LA BIBLIOTECA");
biblio.listar();
System.out.println("NUMERO TOTAL
DE LIBROS EN LA BIBLIOTECA:" + Lib_disp);
}
else if(op==3) {
System.out.println("PRESTAMO DE
LIBROS");
System.out.println("Ingrese el
ISBN: ");
ISBN=leer.next();
System.out.println("Ingrese el
nombre del libro:");
nombreL=leer.next();
System.out.println("Ingrese el
nombre del usuario a prestar el libro:");
usuario=leer.next();
estado=true;
biblio.obtenerPrestamo(ISBN,
estado, usuario);
System.out.println("NUMERO TOTAL
DE LIBROS PRESTADOS");
Lib_disp--;
}
else if(op==4) {
System.out.println("DEVOLUCION DE
LIBROS");
biblio.devolver(ISBN);
}
else if(op==0) {
System.out.println("Gracias pro
utilizar el programa :)");
break;
}
}
}