Created
March 28, 2017 20:42
-
-
Save coke1337/d9caf40c0f926972b6a5e48678c64596 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication3 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
double cv = 0, ct = 0, cb = 0, cr = 0; | |
string tv; | |
Console.WriteLine("Bem vindo a Adega mais dificil de programar de todos os tempos! \nObs: Foi dificil mesmo!"); | |
Console.WriteLine("Digite [T] para Tinto, [B] para Branco, [R] para Rose, ou [F] para Finalizar: "); | |
do | |
{ | |
tv = Console.ReadLine(); | |
tv = tv.ToUpper(); | |
if (tv == "T") | |
{ | |
cv++; ct++; | |
} | |
else if (tv == "B") | |
{ | |
cv++; cb++; | |
} | |
else if (tv == "R") | |
{ | |
cv++; cr++; | |
} | |
else if (tv != "F") | |
Console.WriteLine("Operação Invalida! Favor Digitar [T] para Tinto, [B] para Branco, [R] para Rose, ou [F] para Finalizar! \nNumero de Tintos ja digitados: " + ct + "\nNumero de Brancos ja digitados: " + cb + "\nNumero de Roses ja digitados: " + cr + "\nTotal de Vinhos: " + cv); | |
} | |
while (tv != "F"); | |
Console.WriteLine("Numero de vinhos Tinto: " + ct + " \nNumero de vinhos Branco: " + cb + " \nNumero de vinhos Rose: " + cr + "\nTotal de vinhos: " + cv); | |
Console.WriteLine("Porcentagem de vinhos Tintos: " + ct*100/cv); | |
Console.WriteLine("Porcentagem de vinhos Brancos: " + cb*100/cv); | |
Console.WriteLine("Porcentagem de vinhos Roses: " + cr*100/cv); | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment