-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMain.java
More file actions
22 lines (16 loc) · 822 Bytes
/
Copy pathMain.java
File metadata and controls
22 lines (16 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
public class Main {
public static void main(String[] args) {
Funcionario f1 = new Funcionario(1, "João");
Produto guitarra = new Instrumento(101, "Guitarra", 1500.0, Categoria.CORDAS, "Cordas", "Fender");
Produto baqueta = new Acessorio(201, "Baqueta", 50.0, Categoria.ACESSORIOS, "Madeira");
f1.cadastrarProduto(guitarra);
f1.cadastrarProduto(baqueta);
Venda venda1 = f1.gerarVenda(1);
venda1.adicionarProduto(guitarra, 1);
venda1.adicionarProduto(baqueta, 2);
System.out.println("\n--- Itens da Venda #" + venda1.getId() + " ---");
venda1.exibirItens();
System.out.println("--------------------------");
System.out.println("Valor total da venda: R$ " + String.format("%.2f", venda1.getValorTotal()));
}
}