public static void Programa() { Textos.IP("Ingrese los siguientes valores"); String nombre = Leer.Texto("nombre del medicamento"); String empacado = Leer.Texto("fecha de empacado"); String vencimiento = Leer.Texto("fecha de vencimiento"); String inicialLote = Leer.Texto("Numero Inicial de Lote"); int cantidadLote = Leer.Enteros("Cantidad de Lotes a Empacar"); Textos.IP("\n"); if (cantidadLote != 0) { for (int i = cantidadLote; i > 1; i--) { for (int j = 1; j < 6; j++) { Textos.IP("Nombre : " + nombre); Textos.IP("Empacado : " + empacado); Textos.IP("Vencimiento : " + vencimiento); Textos.IP("Lote : " + i); Textos.IP("Nurto de Caja : " + inicialLote + "_" + i + ":" + j); Textos.IP("\n"); } } } else { Console.Clear(); } Textos.IP("precione una tecla para salir"); Console.ReadKey(); }
public static void Opciones(int valor) { while (valor != 1234587) { switch (valor) { case 1: Procesos.TablasMultiplicar(Lecturas.leerInt("Ingrese el numero de la tabla que desea")); break; case 2: Procesos.Factorial(Lecturas.leerInt("Ingrese el numero del factorial")); break; case 3: Procesos.Promedio(); break; case 0: valor = 1234587; break; default: Textos.IR("Ingrese una opción valida"); break; } Textos.IR("\nPresione Enter para continuar"); Console.ReadKey(); Console.Clear(); if (valor != 1234587) { Textos.Menu1(); valor = Lecturas.leerInt("ingrese una opcion"); } else { break; } } }
public static Int32 Enteros(String msj) { Textos.IP(msj); int valor = 0; bool numero = int.TryParse(Console.ReadLine(), out valor); if (numero) { return(valor); } else { Textos.IP("sólo se aceptan numeros\nse cerrará el programa"); } return(valor); }
public static void Promedio() { double prom = 0, nota, aux; int cantidad; String mensaje = String.Empty; aux = cantidad = Lecturas.leerInt("Ingrese la cantidad de notas que necesita"); while (aux > 0) { nota = Lecturas.leerDoble("ingrese una nota "); prom += nota; aux--; } prom /= cantidad; mensaje = prom > 6f ? "pasaste" : (prom <6f& prom> 5.5f ? "sufi" : "reprovaste"); Textos.IR(mensaje); }
//Dado nombre del medicamento, fecha de empacado, fecha de vencimiento, número inicial de lote //y cantidad de lotes a empacar Imprima la viñeta para cada caja con el nombre del medicamento, //fecha de empacado y vencimiento, número de lote y número de caja. (son 5 cajas por lote) static void Main(string[] args) { Textos.IP("Control de Medicinas"); Procesos.Programa(); }
internal static string Texto(string msj) { Textos.IP(msj); return(Console.ReadLine()); }
static void Main(string[] args) { Textos.Menu1(); Procesos.Opciones(Lecturas.leerInt("Elija una opcion del menu")); }