You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[I am trying to solve this problem in various ways but sill I am failed. For this reason, I am searching a solution then found your solution but when I try to submit your code it's wrong 5%]
using System;
namespace Extremely_Basic
{
class Program
{
static void Main(string[] args)
{
double a, b, c, d, avg;
string[] values = Console.ReadLine().Split(' ');
a = double.Parse(values[0]);
b = double.Parse(values[1]);
c = double.Parse(values[2]);
d = double.Parse(values[3]);
avg = (a * 2 + b * 3 + c * 4 + d * 1) / (2 + 3 + 4 + 1);
Console.WriteLine("Media: " + Math.Round(avg,1));
if (avg >= 7.0d)
{
Console.WriteLine("Aluno aprovado.");
}
if (avg < 5.0d)
{
Console.WriteLine("Aluno reprovado.");
}
if (avg >= 5.0d && avg <= 6.9d)
{
Console.WriteLine("Aluno em exame.");
Console.Write("Nota do exame: ");
double e = double.Parse(Console.ReadLine());
avg = (avg + e) / 2;
if (avg > 5.0d)
{
Console.WriteLine("Aluno aprovado.");
}
if (avg < 5.0d)
{
Console.WriteLine("Aluno reprovado.");
}
Console.WriteLine("Media final: " + Math.Round(avg,1));
}
Console.ReadKey();
}
}
}
The text was updated successfully, but these errors were encountered:
[I am trying to solve this problem in various ways but sill I am failed. For this reason, I am searching a solution then found your solution but when I try to submit your code it's wrong 5%]
using System;
namespace Extremely_Basic
{
class Program
{
static void Main(string[] args)
{
double a, b, c, d, avg;
string[] values = Console.ReadLine().Split(' ');
a = double.Parse(values[0]);
b = double.Parse(values[1]);
c = double.Parse(values[2]);
d = double.Parse(values[3]);
avg = (a * 2 + b * 3 + c * 4 + d * 1) / (2 + 3 + 4 + 1);
Console.WriteLine("Media: " + Math.Round(avg,1));
if (avg >= 7.0d)
{
Console.WriteLine("Aluno aprovado.");
}
if (avg < 5.0d)
{
Console.WriteLine("Aluno reprovado.");
}
if (avg >= 5.0d && avg <= 6.9d)
{
Console.WriteLine("Aluno em exame.");
Console.Write("Nota do exame: ");
double e = double.Parse(Console.ReadLine());
avg = (avg + e) / 2;
if (avg > 5.0d)
{
Console.WriteLine("Aluno aprovado.");
}
if (avg < 5.0d)
{
Console.WriteLine("Aluno reprovado.");
}
Console.WriteLine("Media final: " + Math.Round(avg,1));
}
}
The text was updated successfully, but these errors were encountered: