Created
February 24, 2022 22:41
-
-
Save flaviorl-net/d7ab3614d6ec560766100d3f063f7a82 to your computer and use it in GitHub Desktop.
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.Write("Escolha a operação: (sum, sub, mult, div): "); | |
string operacao = Console.ReadLine(); | |
Console.Write("Digite o primeiro número: "); | |
int.TryParse(Console.ReadLine(), out int numero1); | |
Console.Write("Digite o segundo número: "); | |
int.TryParse(Console.ReadLine(), out int numero2); | |
var calculadoraStrategy = new CalculadoraStrategy(operacao); | |
int resultado = calculadoraStrategy.Calcular(numero1, numero2); | |
Console.WriteLine("Resultado: {0}", resultado); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment