Skip to content

Commit c26b3de

Browse files
authored
Add files via upload
1 parent 8fdabe2 commit c26b3de

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

CompraDeProduto/Pedido.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package CompraDeProduto;
2+
3+
public class Pedido {
4+
5+
Produto produto;
6+
int quantidade;
7+
int valorTotal;
8+
9+
public Pedido(Produto produto, int quantidade, int valorTotal) {
10+
this.produto = produto;
11+
this.quantidade = quantidade;
12+
this.valorTotal = valorTotal;
13+
}
14+
15+
public Pedido() {
16+
17+
}
18+
19+
void adicionarProduto (Produto produto, int quantidade) {
20+
this.produto = produto;
21+
this.quantidade = quantidade;
22+
this.valorTotal = produto.valor * quantidade;
23+
24+
}
25+
}

0 commit comments

Comments
 (0)