MealPlanApp

MealPlanApp - System.out.println System.out.println(m2.toString System.out.print"Tipo de Cliente" m2. System.out.println

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

View Full Document Right Arrow Icon
import java.io.*; import java.util.*; i public class MealPlanApp{ p public static MealPlan m1, m2 ,m3; public static Scanner teclado; p public static void main(String args[]){ p teclado = new Scanner(System.in); t System.out.println("************ Usuario 1 ************"); System.out.print("Introduce el Nombre: "); String name = teclado.next(); System.out.print("Ingresa el Tipo de Cliente (a/b/c/d): "); String c; c = teclado.next(); char client = c.charAt(0); System.out.print("Ingresa el Tipo de Plan (0/1/2/3): "); int plan = teclado.nextInt(); System.out.print("Ingresa el Saldo: "); double sald = teclado.nextDouble(); System.out.print("¿Plan Vigente? (si/no): "); boolean vigente; if(teclado.next().equals("si")) vigente = true; else vigente = false; v m1 = new MealPlan(name,client,plan,sald,vigente); m2 = new MealPlan("Daniel",'a',1,0,false); m3 = new MealPlan(); m System.out.println(m1.toString()); System.out.print("Tipo de Cliente: "); m1.despliegaTipoCliente();
Background image of page 1

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

View Full DocumentRight 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: System.out.println(); System.out.println(m2.toString()); System.out.print("Tipo de Cliente: "); m2.despliegaTipoCliente(); System.out.println(); System.out.println(m3.toString()); System.out.print("Tipo de Cliente: "); m3.despliegaTipoCliente(); System.out.println(); S double pago=0; System.out.print("\nUsuario: "+m1.getNombre()+". Ingrese el precio del producto que desea comprar: "); pago = teclado.nextDouble(); m1.compraComida(pago); System.out.print("Estimado "+m1.getNombre()+" su Saldo actual es: "+m1.getSaldo()); System.out.print("\n\nIngrese el nombre del cliente que desea cancelar tarjeta: "); String m = teclado.next(); System.out.print("Estatus MealPlan: "); m2.cancelaTarjetaMealPlan(m); System.out.println("\n¿Usuario 1 es igual a Usuario 2?"); if(m1.equals(m2)) System.out.println(" & Sí son iguales."); else System.out.println(" & No son iguales."); S } }...
View Full Document

This note was uploaded on 10/29/2009 for the course ITC TC-1002 taught by Professor X during the Spring '09 term at ITESM.

Page1 / 2

MealPlanApp - System.out.println System.out.println(m2.toString System.out.print"Tipo de Cliente" m2. System.out.println

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