-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoze.java
More file actions
34 lines (18 loc) · 1.06 KB
/
doze.java
File metadata and controls
34 lines (18 loc) · 1.06 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
import java.util.Scanner;
public class doze {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Digite o número de carros vendidos: ");
int numeroCarrosVendidos = scanner.nextInt();
System.out.print("Digite o valor total das vendas: R$ ");
double valorTotalVendas = scanner.nextDouble();
System.out.print("Digite o salário fixo do vendedor: R$ ");
double salarioFixo = scanner.nextDouble();
System.out.print("Digite o valor da comissão por carro vendido: R$ ");
double comissaoPorCarro = scanner.nextDouble();
double comissaoTotal = (numeroCarrosVendidos * comissaoPorCarro) + (valorTotalVendas * 0.05);
double salarioFinal = salarioFixo + comissaoTotal;
System.out.printf("O salário final do vendedor é: R$ %.2f%n", salarioFinal);
scanner.close();
}
}