This code does not make much sense and is full of incoherent things. One part I think you’ll complete later (I think you’ll get the data conversion wrong, the hint is when you do it, search on).
First of all don’t use keywords as variable names. Don’t actually create variables without need. Understand what a variable. It is not that I can not use keywords as variables, but it gets ugly and this should only be used in complex code that the name needs very much to be this word to be more readable. Your code creates confusion and becomes less readable. Can you give a plausible justification to create a variable to put a text that will only be used once and that its content does not change and is obvious? Worse, why does he need to use these keywords?
Without plausible justifications don’t do anything in your code.
In fact this code does not even compile, so it would work, although the average will be fixed.
using static System.Console;
public class Program {
public static void Main() {
WriteLine("Digite um número:");
var aluno = ReadLine();
var nota1 = 0.0;
var nota2 = 0.0;
var nota3 = 0.0;
var nota4 = 0.0;
var media = (nota1 + nota2 + nota3 + nota4) / 4;
WriteLine ($"{aluno} tem média {media} está: {(media >= 5 ? "Aprovado" : "Reprovado")}.");
}
}
Behold working in the ideone. And in the .NET Fiddle. Also put on the Github for future reference.
Did any of the answers solve your question? Do you think you can accept one of them? Check out the [tour] how to do this, if you haven’t already. You would help the community by identifying what was the best solution for you. You can accept only one of them. But you can vote on any question or answer you find useful on the entire site
– Maniero