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 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); }
static void Main(string[] args) { Textos.Menu1(); Procesos.Opciones(Lecturas.leerInt("Elija una opcion del menu")); }