0
respostas

Desafio: Calculando valor da entrega

static void ValorEntrega()
{
Console.WriteLine("Qual a distancia?");
float distancia = float.Parse(Console.ReadLine());

float valorEntrega;
float taxaChuva = 2.00f;
float total = 0f;

Console.WriteLine("Está chovendo? (true / false");
bool chuva = bool.Parse(Console.ReadLine());

if (distancia <= 5f)
{
   total = 5.00f;
   
}
else if(distancia > 5f || distancia < 10f)
{
    total = 8.00f;
}
else if(distancia > 10)
{
    total = 10.00f;
}

if (!chuva)
{
   
    Console.WriteLine("O valor da entrega fica RS " + total);
}
else
{
    total = total + taxaChuva;
    Console.WriteLine("O valor da entrtega é RS " + total);
}

}