MealPlan - cliente" c public String regresaTipoPlan...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
public class MealPlan{ p public String nombre; public char tipoCliente; public int tipoPlan; public double saldo; public boolean planVigente; p // Constructores / public MealPlan(){ nombre="Usuario"; tipoCliente='z'; tipoPlan=0; saldo=1; planVigente=false;} p public MealPlan(String n, char tc, int tp, double s, boolean pv){ nombre=n; tipoCliente=tc; tipoPlan=tp; saldo=s; planVigente=pv;} p public String getNombre(){ return nombre;} r public char getTipocliente(){ return tipoCliente;} r public int getTipoPlan(){ return tipoPlan;} r public double getSaldo(){ return saldo;} r public boolean getPlanVigente(){ if(planVigente==false) return false; else return true;} r // Otros métodos / public void despliegaTipoCliente(){ switch(tipoCliente){ case 'a': System.out.print("Alumno"); break; case 'b': System.out.print("Profesor"); break; case 'c': System.out.print("Administrativo"); break; case 'd': System.out.print("Intendencia"); break; default: System.out.print("No existe ese tipo de
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cliente");}} c public String regresaTipoPlan(){ switch(tipoPlan){ case 0: return "Básico"; case 1: return "Completo"; case 2: return "Preferencial"; case 3: return "Global"; default: return "No existe ese plan";}} d public void cancelaTarjetaMealPlan(String n){ if(nombre.equals(n) && saldo==0) System.out.println("Tarjeta MealPlan cancelada."); else System.out.println("Siga disfrutando de nuestros servicios.");} s public void compraComida(double pago){ saldo = saldo-pago;} s public boolean equals(MealPlan mp){ if(nombre.equals(mp.nombre) && tipoCliente==mp.tipoCliente && tipoPlan==mp.tipoPlan && saldo==mp.saldo && planVigente==mp.planVigente) return true; else return false;} r public String toString(){ return "\nNombre: "+nombre+"\nTipo de Plan: "+regresaTipoPlan() +"\nSaldo: "+saldo+"\nPlan Vigente: "+planVigente;} + }...
View Full Document

{[ snackBarMessage ]}

Page1 / 2

MealPlan - cliente" c public String regresaTipoPlan...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online