Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace clasePromedio
{
class clasePromedio
{
case 2:
if (entro2 == false)
{
calculoPromedio()
entro2 = true;
}
else
{
Console.WriteLine("********Ya se hizo el CALCULO DE
PROMEDIOS********");
Console.ReadKey();
}
break;
case 3:
if (entro3 == false)
{
mostrarDatos();
entro3 = true;
}
else
{
Console.WriteLine("********Ya se IMPRIMIERON LOS
RESULTADOS********");
Console.WriteLine("****************SALIR DEL
SISTEMA***************");
Console.ReadKey();
}
break;
case 4:
Console.Clear();
Console.WriteLine("----FIN DEL PROGRAMA----");
break;
default:
Console.WriteLine("----OPCION INCORRECTA----");
break;
}
}
while (opcion <> 4 )
Console.ReadKey();
}
}
}
*******************************************
using System;
namespace clasePromedio
{
class clasePromedio
{
}
//impresion del men� de opciones
private static void imprimirMenu()
{
do
{
Console.Clear();
Console.WriteLine("--IMPRIMIENDO MENU--\n");
Console.WriteLine("1. LECTURA DE DATOS");
Console.WriteLine("2. CALCULO DE PROMEDIO");
Console.WriteLine("3. MOSTRAR DATOS");
Console.WriteLine("4. SALIR\n");
Console.Write("Elige una opci�n: ");
opcion = int.Parse(Console.ReadLine());
switch (opcion)
{
case 1:
if (entro1 == false)
{
entradaDatos();
entro1 = true;
}
else
{
Console.WriteLine("********Ya se hizo la LECTURA DE
DATOS********");
Console.ReadKey();
}
break;
case 2:
if (entro2 == false)
{
calculoPromedio(); //falta ;
entro2 = true;
}
else
{
Console.WriteLine("********Ya se hizo el CALCULO DE
PROMEDIOS********");
Console.ReadKey();
}
break;
case 3:
if (entro3 == false)
{
mostrarDatos();
entro3 = true;
}
else
{
Console.WriteLine("********Ya se IMPRIMIERON LOS
RESULTADOS********");
Console.WriteLine("****************SALIR DEL
SISTEMA***************");
Console.ReadKey();
}
break;
case 4:
Console.Clear();
Console.WriteLine("----FIN DEL PROGRAMA----");
break;
default:
Console.WriteLine("----OPCION INCORRECTA----");
break;
}
}
while (opcion > 4);//sobra un signo y faltaba ;
}