Código fuente ejercicio:
using System;
namespace TallerItert_Juan_Felipe_Aristizabal_Diaz
{
class Program
{
static void Main(string[] args)
{
float noota1, noota2, noota3, noota4;
int n = 0;
// int ins, suf, sob, exc;
Console.WriteLine("Digite el número de estudiantes: ");
n = int.Parse(Console.ReadLine());
for (int i = 1; i <= n; i++)
{
Console.WriteLine("Ingrese su nombre: ");
string nombre = Console.ReadLine();
Console.WriteLine("Ingrese su nota 1: ");
string lineaa = Console.ReadLine();
noota1 = 0;
noota1 = float.Parse(lineaa);
Console.WriteLine("Ingrese su nota 2: ");
string lineaa1 = Console.ReadLine();
noota2 = float.Parse(lineaa1);
Console.WriteLine("Ingrese su nota 3: ");
string lineaa2 = Console.ReadLine();
noota3 = float.Parse(lineaa2);
Console.WriteLine("Ingrese su nota 4: ");
string lineaa3 = Console.ReadLine();
noota4 = float.Parse(lineaa3);
float promm2;
float promm1 = (noota1 + noota2 + noota3 + noota4);
promm2 = promm1 / 4;
Console.WriteLine($"{nombre} tu promedio es de {prom2}");
// Esta sección me saca error porque no reconoce las variables (ins,suf,sob,exc) aunque las declaré
// {
// if (prom2 < 2.94)
// {
// ins = ins + 1;
// }
// if (prom2 == 2.95 && prom2 <= 3.94)
// {
// suf = suf + 1;
// }
// if (prom2 == 3.95 && prom2 <= 4.44)
// {
// sob = sob + 1;
// }
// if (prom2 > 4.44)
// {
// exc = exc + 1;
// }
// }
// }
// Console.WriteLine($"{ins} estudiantes en insuficiente");
// Console.WriteLine($"{suf} estudiantes en suficiente");
// Console.WriteLine($"{sob} estudiantes en sobresaliente");
// Console.WriteLine($"{exc} estudiantes en excelente");
}
}
}
}
No hay comentarios:
Publicar un comentario