import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
//Entrada
System.out.print("Digite a distancia até o cliente (em Km): ");
double distancia = scanner.nextDouble();
System.out.print("Está chovendo? (sim/nao): ");
String resposta = scanner.next().toLowerCase();
while (!resposta.equals("sim") && !resposta.equals("nao")) {
System.out.print("Resposta inválida! Digite apenas sim ou nao: ");
resposta = scanner.next().toLowerCase();
}
boolean estaChovendo = resposta.equals("sim");
double taxaBase;
//Processamento
if (distancia <= 5) {
taxaBase = 5.00;
} else if (distancia <= 10) {
taxaBase = 8.00;
} else {
taxaBase = 12.00;
}
if (estaChovendo) {
taxaBase += 2.00;
}
//Saída
System.out.printf("Taxa de entrega: R$ %.2f%n", taxaBase);
scanner.close();
}
}

