Professional Documents
Culture Documents
Ricardo Moscoso Montesinos
Ricardo Moscoso Montesinos
ROCKOLA
MAIN.JAVA
import java.util.Scanner;
Listdisc reproduce;
String moneda;
int cant;
do{
try{
cant=entrada.nextInt();
if(cant<=0 || cant>5){
}else break;
}catch(Exception ex){
entrada.nextLine();
}while(true);
entrada.nextLine();
System.out.println("\ncanción "+(i+1));
if(moneda.equals("1")){
}else{
LISTDISC.JAVA
import java.util.ArrayList;
import java.util.Scanner;
this.moneda = moneda;
elegir_cancion(crearListaArtistas());
parar();
artistas.add(new Artista("Paul","Newman",album));
artistas.add(new Artista("Tom","Cruise",album));
artistas.add(new Artista("Sharon","Stone",album));
return artistas;
return album;
canciones.add(new Cancion(titulos[i]));
}
return canciones;
int op;
if(this.moneda==1){
do{
try{
System.out.println("\nLISTA DE ARTISTAS");
System.out.println((i+1)+" . "+artistas.get(i).getNombre()+"
"+artistas.get(i).getApellido());
op=entrada.nextInt();
artista=op;
break;
}else{
}catch(Exception ex){
entrada.nextLine();
}while(true);
}
public void elige_album(ArrayList<Artista> artistas){
elige_Artista(artistas);
int op;
do{
try{
System.out.println("\nLISTA DE ALBUNES");
System.out.println((i+1)+" . "+artistas.get(artista-
1).getAlbum().get(i).getNombreAlbum());
op=entrada.nextInt();
album=op;
break;
}else{
}catch(Exception ex){
entrada.nextLine();
}while(true);
int op;
elige_album(artistas);
ArrayList<Cancion> canciones=artistas.get(artista-1).getAlbum().get(album-
1).getCanciones();
do{
try{
System.out.println("\nLISTA DE CANCIONES");
System.out.println((i+1)+" . "+canciones.get(i).getTitulo());
op=entrada.nextInt();
break;
}else{
}catch(Exception ex){
entrada.nextLine();
}while(true);
String respuesta;
entrada.nextLine();
System.out.println();
do{
respuesta=entrada.nextLine();
if(respuesta.toUpperCase().equals("S")){
System.out.println("Reproducción detenida...Gracias");
break;
}else if(respuesta.toUpperCase().equals("N")){
break;
}else{
}while(true);
CANCION.JAVA
this.titulo = titulo;
return titulo;
@Override
ARTISTA.JAVA
package ejercicio;
import java.util.ArrayList;
this.nombre=nombre;
this.apellido=apellido;
this.album=album;
return nombre;
return album;
return apellido;
ALBUM.JAVA
import java.util.ArrayList;
public class Album {
this.nombreAlbum = nombreAlbum;
this.canciones = canciones;
return nombreAlbum;
return canciones;