-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathonze.java
More file actions
22 lines (15 loc) · 764 Bytes
/
onze.java
File metadata and controls
22 lines (15 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import java.util.Scanner;
public class onze {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Digite o custo de fábrica do carro: R$ ");
double custoFabrica = scanner.nextDouble();
double percentualDistribuidor = 0.28;
double percentualImpostos = 0.45;
double custoDistribuidor = custoFabrica * percentualDistribuidor;
double custoImpostos = custoFabrica * percentualImpostos;
double custoFinal = custoFabrica + custoDistribuidor + custoImpostos;
System.out.printf("O custo final ao consumidor é: R$ %.2f%n", custoFinal);
scanner.close();
}
}