Created
November 24, 2013 18:46
-
-
Save fabriciosanchez/7630742 to your computer and use it in GitHub Desktop.
Calculadora simples (método Main)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Main(string[] args) | |
{ | |
String Valor = ""; | |
List<string> Valores = new List<string>(); | |
Console.WriteLine("Olá. Seja bem vindo a esta calculadora.\n"); | |
Console.WriteLine("Diga-nos, qual operação (+, -, *, /) deseja realizar?\n"); | |
string Operador = Console.ReadLine(); | |
Operador = ValidaEntradaDeOperador(Operador); | |
while (Valor != "p" && Valor != "P") | |
{ | |
Console.WriteLine("Informe o valor a ser incorporado à operação matemática. Se quiser parar, digite 'P':\n"); | |
Valor = Console.ReadLine(); | |
Valores.Add(Valor); | |
} | |
MontaRespostaDaOperacaoMatematica(FazOperacaoMatematica(Valores, Convert.ToChar(Operador)).ToString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment