-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAula30Exercicio5.java
More file actions
40 lines (23 loc) · 959 Bytes
/
Copy pathAula30Exercicio5.java
File metadata and controls
40 lines (23 loc) · 959 Bytes
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
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int codigo1, codigo2, numeroPecas1, numeroPecas2;
double valorUnitario1, valorUnitario2, valorFinal;
Scanner sc = new Scanner(System.in);
System.out.printf("Informe o código do produto 1 %n");
codigo1 = sc.nextInt();
System.out.printf("Informe a quantidade de peças %n");
numeroPecas1 = sc.nextInt();
System.out.printf("Informe o valor unitario %n");
valorUnitario1 = sc.nextDouble();
System.out.printf("Informe o código do produto 2 %n");
codigo2 = sc.nextInt();
System.out.printf("Informe a quantidade de peças %n");
numeroPecas2 = sc.nextInt();
System.out.printf("Informe o valor unitario %n");
valorUnitario2 = sc.nextDouble();
valorFinal = (valorUnitario1 * numeroPecas1) + (valorUnitario2 * numeroPecas2);
System.out.printf("valor a ser pago: %.2f", valorFinal);
sc.close();
}
}