{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

MealPlanApp - System.out.println...

Info icon This 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();
Image of page 1

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

View Full Document Right Arrow Icon
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern