-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex_1038.java
More file actions
51 lines (35 loc) · 1.03 KB
/
Copy pathex_1038.java
File metadata and controls
51 lines (35 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package curso_programacao;
import java.util.Scanner;
public class ex_1038 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int codigo = sc.nextInt();
int quantidade = sc.nextInt();
double cachorro_Quente = 4;
double x_Salada = 4.5;
double x_Bacon = 5;
double torrada_Simples = 2;
double refrigerante = 1.5;
if (codigo == 1) {
double total = cachorro_Quente * quantidade;
System.out.printf("Total: R$ %.2f%n", total);
}
else if (codigo == 2) {
double total = x_Salada * quantidade;
System.out.printf("Total: R$ %.2f%n", total);
}
else if (codigo == 3) {
double total = x_Bacon * quantidade;
System.out.printf("Total: R$ %.2f%n", total);
}
else if (codigo == 4) {
double total = torrada_Simples * quantidade;
System.out.printf("Total: R$ %.2f%n", total);
}
else if (codigo == 5) {
double total = refrigerante * quantidade;
System.out.printf("Total: R$ %.2f%n", total);
}
sc.close();
}
}