Skip to content
Snippets Groups Projects
Commit 5062b8e0 authored by carmuno's avatar carmuno :tennis:
Browse files

cambios

parent f03de031
No related branches found
No related tags found
No related merge requests found
......@@ -42,4 +42,5 @@ public class Infantiles extends Billete implements Persona {
}
}
......@@ -19,11 +19,18 @@ public class Coleccion <E extends Play> {
lista.add(element);
}
public E get(int pos) {
public E get(int pos) { //sacar.
return lista.get(pos);
}
public void remove(int pos) {
public void remove(int pos) { //atender.
if(listavacia()) {
throw new IllegalArgumentException("mala entrada");
}
//ver primero si esta vacia o no la lista ojo
lista.remove(pos);
}
......@@ -31,6 +38,21 @@ public class Coleccion <E extends Play> {
lista.stream().forEach(play -> play.Play());
}
public void playAllmaseasy() {
for(int i = 0; i< lista.size(); i++) {
lista.get(i);
}
}
public boolean listavacia() {
return lista.isEmpty();
}
public ArrayList<E> getLista(){
return (ArrayList<E>) lista.clone();
}
......
......@@ -40,7 +40,18 @@ public class CineCien extends Factura{
return "Estoy en una factura de cine cien";
}
public void setFIJO(int valor) {
if(valor<0) {
throw new IllegalArgumentException();
}
this.FIJO = valor;
}
......
......@@ -2,6 +2,8 @@ package ord_18_19_2º;
public class Premium extends Factura{
private static final int FIJO = 3;
public Premium(Cliente cliente) {
super(cliente);
......@@ -20,7 +22,7 @@ public class Premium extends Factura{
@Override
public double pagototal() {
return super.pagototal()+3;
return super.pagototal()+FIJO;
}
......
......@@ -3,7 +3,7 @@ package ord_18_19_2º;
public class SerieAdictos extends Factura{
private int cont;
private int cont = 1;
public SerieAdictos(Cliente cliente) {
super(cliente);
......@@ -16,16 +16,14 @@ public class SerieAdictos extends Factura{
if(cont == 1) {
super.pagoseries(c, cantidad);
cont = 2;
}
else {
//este el el segundo y el segundo se factira a coste 0.
cont = 1;
if(cont == 2) {
//este el el segundo y el segundo se factura a coste 0.
super.pagoseries(c, 0);
cont = 1;
}
......
......@@ -37,7 +37,7 @@ public class RankingTopTen <T> {
*/
public void nominar_elemento(T elemento_a_nominar) {
assert(abierto)==false;
assert(!abierto);
assert(nominados.contains(elemento_a_nominar));
nominados.add(elemento_a_nominar);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment