Example #1
0
        static void Main(string[] args)
        {
            int menu, minutos;

            Gatito batman = new Gatito("Antonio", true, 30);

            Console.WriteLine("Este es el menu.., para saber el nombre del gatito ingrese[1], para saber si esta vacunado[2], para hacerlo jugar ingrese[3](gasta 2*minutos jugados), para que el gatito coma(recupera 50 de energia)[4],para saber si esta Saludable[5]:\n");
            menu = Int32.Parse(Console.ReadLine());

            switch (menu)
            {
            case 1:
                Console.WriteLine("El nombre del gatito es:" + batman.Nombre());
                break;

            case 2:
                Console.WriteLine("El gatito esta vacunado?" + batman.EstaVacunado());
                break;

            case 3:
                minutos = Int32.Parse(Console.ReadLine());
                Console.WriteLine("El gatito ha jugado y ahora tiene" + batman.Jugar(minutos) + "de Energia");
                break;

            case 4:
                Console.WriteLine("El gatito ha comido asi que ahora mismo tiene" + batman.Comer() + "de Energia");
                break;

            case 5:
                Console.WriteLine("El gatito esta saludable?" + batman.EstaSaludable());
                break;
            }
        }
            static void Main(string[] args)
            {
                int    opcion1 = 1, opcion = 0, minutos = 0;
                Gatito batman = new Gatito("batman", true, 31);

                do
                {
                    Console.WriteLine("1)Nombre\n2)¿Esta vacunado?\n3)Jugar\n4)Comer\n5)¿Esta saludable?");
                    opcion = Int32.Parse(Console.ReadLine());
                    if (opcion == 1)
                    {
                        Console.WriteLine("El nombre del gatito es: " + batman.nombregat());
                    }
                    if (opcion == 2)
                    {
                        Console.WriteLine("El gatito esta vacunado: " + batman.estavacunado());
                    }
                    if (opcion == 3)
                    {
                        Console.WriteLine("¿Cuantos minutos jugara el gatito?");
                        minutos = Int32.Parse(Console.ReadLine());
                        Console.WriteLine("El gatito jugo, ahora tiene de energia: " + batman.juego(minutos));
                    }
                    if (opcion == 4)
                    {
                        Console.WriteLine("El gatito comio, ahora tiene de energia: " + batman.comio());
                    }
                    if (opcion == 5)
                    {
                        Console.WriteLine("El gatito esta saludable: " + batman.estasaludable());
                    }
                    Console.WriteLine("¿quiere realizar o saber algo mas del gatito?\n1)si\n2)no");
                    opcion1 = Int32.Parse(Console.ReadLine());
                }while(opcion1 == 1);
            }
        static void Main(string[] args)
        {
            int    opcion = 0, juega = 0, opcion1 = 1;
            Gatito domino = new Gatito("domino", true, 45);

            do
            {
                Console.WriteLine("Que desea saber del gatito? \n[1] Para saber el nombre \n[2] Para saber si esta vacunado \n[3] Cuanta energia le queda despues de jugar \n[4] Para recargar energia \n[5] Para saber si el gatito esta saludable");
                opcion = Int32.Parse(Console.ReadLine());
                if (opcion == 1)
                {
                    Console.WriteLine("El nombre del gatito es " + domino.nombreGatito());
                }
                if (opcion == 2)
                {
                    Console.WriteLine("El gato esta vacunado? " + domino.estaVacunado());
                }
                if (opcion == 3)
                {
                    Console.WriteLine("ingrese los minutos de juego: ");
                    juega = Int32.Parse(Console.ReadLine());
                    Console.WriteLine("El gato tiene energia de: " + domino.cuantoJuega(juega));
                }
                if (opcion == 4)
                {
                    Console.WriteLine("La energia actual del gatito es: " + domino.Comer());
                }
                if (opcion == 5)
                {
                    Console.WriteLine("El gatito esta saludable? " + domino.estaSaludable());
                }
                Console.WriteLine("¿Quiere realizar otra operacion?\n1)Si\n2)No");
                opcion1 = Int32.Parse(Console.ReadLine());
            }while(opcion1 == 1);
        }
        static void Main(string[] args)
        {
            Gatito misi = new Gatito("misi", true, 40);

            int minu;
            int menu = 0;



            while (menu != 6)
            {
                Console.Clear();
                Console.WriteLine("--------");
                Console.WriteLine("| Menu:|");
                Console.WriteLine("--------\n");
                Console.WriteLine("|Ver el nombre del gatito|1");
                Console.WriteLine("|Saber si esta vacuando  |2");
                Console.WriteLine("|Hacer jugar al gatito   |3");
                Console.WriteLine("|Darle de comer al gatito|4");
                Console.WriteLine("|Saber si esta saludable |5");
                Console.WriteLine("|Salir del programa      |6");
                Console.Write("Elija la opcion desea hacer: ");
                menu = Int32.Parse(Console.ReadLine());

                switch (menu)
                {
                case 1:
                    Console.WriteLine("El nombre el gatito es: " + misi.Nombres());
                    break;

                case 2:
                    Console.WriteLine("El gato esta vacunado?" + misi.estaVacunado());
                    break;

                case 3:
                    Console.WriteLine("Ingrese cuantos minutos jugo el gatito");
                    minu = Int32.Parse(Console.ReadLine());
                    Console.WriteLine("El gatito es jugando y su enegia es ahora: " + misi.Jugar(minu));
                    break;

                case 4:
                    Console.WriteLine("El gatito esta comiendo, la energia del gatito es ahora: " + misi.Comer());
                    break;

                case 5:
                    Console.WriteLine("El gatito esta saludable?" + misi.estaSaludable());
                    break;

                case 6:
                    Console.WriteLine("Saliendo del programa");
                    break;

                default:
                    Console.WriteLine("Ingrese una opcion valida");
                    break;
                }
                Console.ReadKey();
            }
        }
Example #5
0
        static void Main(string[] args)
        {
            int    selec = 0;
            Gatito pepe  = new Gatito("pepe", true, 35);

            while (selec != 6)
            {
                Console.Write("\n\n1 - Consultar nombre del gatito\n2 - Consultar si esta vacunado\n");
                Console.Write("3 - Jugar con el gatito\n4 - Darle de comer al gatito\n");
                Console.Write("5 - Consultar si el gatito se encuentra saludable\n6 - Salir\n\n");
                Console.Write("Ingrese una seleccion: ");
                selec = Int32.Parse(Console.ReadLine());
                switch (selec)
                {
                case 1:
                    Console.Write("El nombre del gatito es " + pepe.Nombre());
                    break;

                case 2:
                    if (pepe.EstaVacunado())
                    {
                        Console.Write("El gatito esta vacunado");
                    }
                    else
                    {
                        Console.Write("El gatito no esta vacunado");
                    }
                    break;

                case 3:
                    Console.Write("Ingrese cantidad de minutos que desea jugar con el gatito: ");
                    pepe.Jugar(Int32.Parse(Console.ReadLine()));
                    break;

                case 4:
                    pepe.Comer();
                    break;

                case 5:
                    if (pepe.EstaSaludable())
                    {
                        Console.Write("El gatito esta saludable");
                    }
                    else
                    {
                        Console.Write("El gatito no esta saludable");
                    }
                    break;

                default:
                    if (selec != 6)
                    {
                        Console.Write("Ingrese una seleccion valida");
                    }
                    break;
                }
            }
        }
Example #6
0
        static void Main(string[] args)
        {
            Gatito Firulays     = new Gatito("Filulays", true, 40);
            int    minutosJuego = 0;

            Console.WriteLine("[1]ver nombre \n[2]ver vacunas \n[3]hacerlo jugar \n[4]dar de comer \n[5]ver salud");

            switch (Console.ReadLine())
            {
            case "1":
                Console.WriteLine("El gatito de llama " + Firulays.Nombre());
                break;

            case "2":
                if (Firulays.EstaVacunado())
                {
                    Console.WriteLine("El gatito esta vacunado");
                }
                else
                {
                    Console.WriteLine("El gatito no esta vacunado");
                }
                break;

            case "3":
                Console.WriteLine("Ingrese los minutos de juego");
                minutosJuego = Int32.Parse(Console.ReadLine());
                Console.WriteLine("Le queda " + Firulays.Jugar(minutosJuego) + " de energia");
                break;

            case "4":
                Console.WriteLine("El gatito ahora tiene " + Firulays.Comer() + " de energia");
                break;

            case "5":
                if (Firulays.EstaSaludable())
                {
                    Console.WriteLine("El gatito esta saludable");
                }
                else
                {
                    Console.WriteLine("El gatito no esta saludable");
                }
                break;

            default:
                Console.WriteLine("Opcion invalida");
                break;
            }
        }
Example #7
0
        static void Main(string[] args)
        {
            Gatito gaturro = new Gatito("gaturro", true, 50);
            int    salir   = 1;
            int    opcion  = 0;

            while (salir == 1)
            {
                Console.WriteLine("Ingrese:\n[1]Para ver el nombre del gatito\n[2]Para ver si esta vacunado\n[3]Para jugar\n[4]Para darle de comer\n[5]Para ver si esta saludable");
                opcion = Int32.Parse(Console.ReadLine());
                switch (opcion)
                {
                case 1:
                    Console.WriteLine("El nombre del gato es " + gaturro.Nombre());
                    break;

                case 2:
                    Console.WriteLine("¿El gato esta vacunado? " + gaturro.estaVacunado());
                    break;

                case 3:
                    int minutos = 0;
                    Console.WriteLine("Ingrese cuantos minutos va a jugar con el gato");
                    minutos = Int32.Parse(Console.ReadLine());
                    gaturro.Jugar(minutos);
                    Console.WriteLine("¡Has terminado de jugar!");
                    break;

                case 4:
                    gaturro.comer();
                    Console.WriteLine("El gatito ha comido!");
                    break;

                case 5:
                    Console.WriteLine("¿El gato es saludable? " + gaturro.estaSaludable());
                    break;

                default:
                    Console.WriteLine("No has elegido ninguna opcion");
                    break;
                }
                Console.WriteLine("La energia de " + gaturro.Nombre() + " es de " + gaturro.energy());
                Console.WriteLine("Ingrese 1 para elegir otras opciones o otro para salir: ");
                salir = Int32.Parse(Console.ReadLine());
            }
        }
Example #8
0
        static void Main(string[] args)
        {
            int    decision = 1, minutos = 0;
            Gatito batman = new Gatito("batman", true, 50);

            Console.WriteLine("ingrese 1 si quiere saber si quiere saber que el gatito esta saludable");
            Console.WriteLine("ingrese 2 si quiere saber el nombre del gatito");
            Console.WriteLine("ingrese 3 si quiere que el gatito juegue");
            Console.WriteLine("ingrese 4 si quiere que el gatito coma");
            Console.WriteLine("ingrese 0 si quiere salir");
            while (decision != 0)
            {
                decision = Int32.Parse(Console.ReadLine());
                if (decision == 1)
                {
                    Console.WriteLine("El gatito esta vacunado? " + batman.estaSaludable());
                }
                else
                {
                    if (decision == 2)
                    {
                        Console.WriteLine("nombre del gatito=" + batman.nombre);
                    }
                    else
                    {
                        if (decision == 3)
                        {
                            Console.WriteLine("energia del gatito= " + batman.energia);
                            Console.WriteLine("ingrese los minutos de juego");
                            minutos = Int32.Parse(Console.ReadLine());
                            batman.estajugando(minutos);
                            Console.WriteLine("energia del gatito= " + batman.energia);
                        }
                        else
                        {
                            if (decision == 4)
                            {
                                Console.WriteLine("energia del gatito= " + batman.energia);
                                batman.estaComiendo();
                                Console.WriteLine("el gatito ya comio, energia del gatito= " + batman.energia);
                            }
                        }
                    }
                }
            }
        }
        static void Main(string[] args)
        {
            int    minutos = 0;
            int    num     = 0;
            Gatito Robin   = new Gatito("Robin", true, 30);

            while (num != 6)
            {
                Console.WriteLine("1°)Nombre: 2°)Vacunas: 3°)jugar: 4°)Comer: 5°)Salud: 6)Para salir ");
                Console.WriteLine("selecciones una opcion por favor: ");
                num = Int32.Parse(Console.ReadLine());
                switch (num)
                {
                case 1:
                    Console.WriteLine("El gatito se llama: " + Robin.Nombre());
                    break;

                case 2:
                    Console.WriteLine("El gato esta saludable? " + Robin.EstaVacunado());
                    break;

                case 3:
                    Console.WriteLine("ingrese cuantos minutos juego el gato: ");
                    minutos = Int32.Parse(Console.ReadLine());
                    break;

                case 4:
                    Console.WriteLine("El gato comio ");
                    Robin.Comer();
                    break;

                case 5:
                    Console.WriteLine("El gato esta saludable? :" + Robin.EstaSaludable());
                    break;
                }
            }
        }
        static void Main(string[] args)
        {
            int id     = 0;
            int min    = 0;
            int comida = 0;

            Gatito Ciro = new Gatito("Ciro", true, 30);

            Console.WriteLine(" [1] Nombre\n [2] EstaVacunado\n [3] Jugar\n [4] Comer\n [5] EstaSaludable");

            id = Int32.Parse(Console.ReadLine());

            switch (id)
            {
            case 1:
            {
                Console.WriteLine("El nombre del gato es: " + Ciro.nombreGato());
                break;
            }

            case 2:
            {
                if (Ciro.estaVacunado())
                {
                    Console.WriteLine("El gato esta vacunado");
                }
                else
                {
                    Console.WriteLine("El gato no esta vacunado");
                }
                break;
            }

            case 3:
            {
                Console.WriteLine("Cuantos minutos juega el gato?");
                min = Int32.Parse(Console.ReadLine());

                Console.WriteLine("Jugó " + min + " minutos y le quedan " + Ciro.jugar(min) + " puntos de energia");

                break;
            }

            case 4:
            {
                Console.WriteLine("Cuantos veces come el gato?");
                comida = Int32.Parse(Console.ReadLine());

                Console.WriteLine("Comio " + comida + " veces y ahora tiene " + Ciro.comer(comida) + " puntos de energia");

                break;
            }

            case 5:
            {
                if (Ciro.estaSaludable())
                {
                    Console.WriteLine("El gato no esta saludable");
                }
                else
                {
                    Console.WriteLine("El gato no esta saludable");
                }

                break;
            }
            }
        }