algoritmo "CalcularEntrega"

var
nome, resposta:caractere
distancia, taxa_dist, taxa_chuva, taxa_total: real
inicio
Escreval("---------------------")
Escreval(" VALORES DE ENTREGA :)")
Escreval(" CONFIRA A RELAÇÃO DE VALORES ABAIXO.")
Escreval(" VALORES VARIAM CONFORME DISTANCIA E DIAS CHUVOSOS.")
Escreval("---------------------")
Escreval(" - Para entregas até 5 km, a taxa é R$ 5,00.")
Escreval(" - Entre 5 e 10 km, a taxa é R$ 8,00.")
Escreval(" - Acima de 10 km, a taxa é R$ 10,00.")
Escreval(" - Se estiver chovendo, acrescenta R$ 2,00 à taxa padrão.")
Escreval("---------------------")
Escreval("Digite seu nome: ")
Leia(nome)
Repita
Escreval(nome, ", Digite a distancia em (KM) ate sua localizaçao: ")
Leia(distancia)
ate (distancia > 0.0)
//Condicionais das Distancias
Se (distancia < 5.00) entao
taxa_dist <- 5.00
Senao
Se (distancia <= 10.00) entao
taxa_dist <- 8.00
Senao
taxa_dist <- 10.00
FimSe
FimSe
Repita
Escreval("Está chovendo? [S/N] | S - SIM, N - NAO")
Leia(resposta)
Maiusc (resposta) //Funcao que sempre converte o caractere para maiusculo.
ate (resposta = "S") ou (resposta = "N")
//Condicional da Chuva
taxa_chuva <- 0.0 //Garante que a variavel sempre tenha valor
Se(resposta = "S")entao
taxa_chuva <- 2.00
FimSe
taxa_total <- taxa_dist + taxa_chuva
Escreval("A taxa total da entrega e: ", taxa_total)
fimalgoritmo