Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URI-1040 solution is not working for me. #2

Open
Mehedy-Hasan opened this issue Aug 28, 2020 · 0 comments
Open

URI-1040 solution is not working for me. #2

Mehedy-Hasan opened this issue Aug 28, 2020 · 0 comments

Comments

@Mehedy-Hasan
Copy link

[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();
    }
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant