java/prog-oo/aula3/src/application/Program1.java
<filename>java/prog-oo/aula3/src/application/Program1.javapackage application;

import java.util.Locale;
import java.util.Scanner;

import entities.Product;

public class Program1 {

    public static void main(String[] args) {
        // Definir layout de teclado. Na dúvida use US para boa compatibilidade.
        Locale.setDefault(Locale.US);
        Scanner sc = new Scanner(System.in);
        Product product = new Product();
        System.out.println(product.toString());
        System.out.println("Enter product data: ");
        System.out.print("Name: ");
        product.name = sc.nextLine();
        System.out.print("Price: ");
        product.price = sc.nextDouble();
        System.out.print("Quantity in stock: ");
        product.quantity = sc.nextInt();
        System.out.println();
        System.out.println("Product data: " + product);
        System.out.println();
        System.out.println("Enter the number of product to be added in stock: ");
        int quantity = sc.nextInt();
        product.addProducts(quantity);
        System.out.println();
        System.out.println("Updated data: " + product);
        System.out.println();
        System.out.print("Enter the number of products to be removed from stock: ");
        quantity = sc.nextInt();
        product.removeProducts(quantity);
        System.out.println();

        System.out.println("Updated data: " + product);
        sc.close();
    }

}
