-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrincipalProduto.java
More file actions
39 lines (25 loc) · 840 Bytes
/
PrincipalProduto.java
File metadata and controls
39 lines (25 loc) · 840 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
package aulapratica;
import java.util.Scanner;
public class PrincipalProduto {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Produto p1 = new Produto();
System.out.println("Nome do produto: ");
p1.nome = sc.nextLine();
System.out.println("Preço: ");
p1.preco = sc.nextDouble();
System.out.println("Quantidade em estoque: ");
p1.quantidade = sc.nextInt();
System.out.println("Entre com o número de produtos para adicionar ao estoque: ");
int add;
add = sc.nextInt();
p1.adicionarProdutos(add);
System.out.println("Dados atualizados: " + p1);
System.out.println("Entre com o número de produtos para remover do estoque: ");
int rm;
rm = sc.nextInt();
p1.removerProdutos(rm);
System.out.println("Dados atualizados: " + p1);
sc.close();
}
}