Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Subasta {
- private double montoInicial;
- private double ofertaActual;
- private boolean apertura;
- Subasta (){
- montoInicial= 100.0;
- ofertaActual = montoInicial;
- apertura = true;
- }
- public void ofertar (double nuevaOferta) {
- if (ofertaAbierta(apertura)){
- if (nuevaOferta > ofertaActual){
- ofertaActual = nuevaOferta;
- }
- }
- }
- public double verOfertaActual (){
- return (ofertaActual);
- }
- public boolean ofertaAbierta (boolean abierto) {
- apertura = abierto;
- return (abierto);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement