TÓPICO
Exercício resolvido de forma simples
UelioCarvalhodosAnjos perguntou 2 years ago
import java.io.IOException; import java.util.Scanner; import java.util.Locale;
public class Main {
public static void main(String[] args) throws IOException {
Scanner input = new Scanner (System.in);
Locale.setDefault(Locale.US);
double cal = 0;
double num = input.nextDouble();
double QTD = input.nextDouble();
if (num == 1 ){
cal = 4.00;
}if(num == 2 ){
cal = 4.50;
}if(num == 3 ){
cal = 5.00;
}if(num == 4 ){
cal = 2.00;
}if(num == 5 ){
cal = 1.50;
}
double soma = cal * QTD;
System.out.printf("Total: R$ %.2f%n" , soma);
}
}
Este tópico foi resolvido e não pode receber novas respostas.