TOPIC

Tá 10% errado, alguém me ajuda?

JapaErick asked 2 months ago

import java.io.IOException; import java.util.Scanner; public class Main { public static void main (String []args){ Scanner s = new Scanner(System.in); int n = s.nextInt(); int m = s.nextInt(); double total = 0.00;

switch(n)

{ case 1: total += 4.00; break;

case 2:
        total += 4.50;
        break;

case 3:
        total += 5.00;
        break;
case 4:
        total += 2.00;
        break;

case 5:
        total += 1.50;
        break;

default:
        System.out.println("Digite um valor entre 1~5");
        return;

} total *= (double)m; System.out.println("Total: R$ "+total); } }

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.