#include <iostream>
using namespace std;

#include "Product.cpp"

class ProductOrder {
public:
    ProductOrder();
    ProductOrder(string name, double price,
                 int prodQuantity);
    Product getProduct() { return prod; }
    double getQuantity() { return quantity; }
    void setProduct(Product& newProduct);
    void setQuantity(int newQuantity);
    double getTotal();
    void showData();
private:
    Product prod;
    int quantity;
};

ProductOrder::ProductOrder() {
    quantity = 0;
}

ProductOrder::ProductOrder(string name, double price,
        int prodQuantity): prod(name, price) {
    quantity = prodQuantity;
}

void ProductOrder::setProduct(Product& newProduct) {
    prod = newProduct;
}

void ProductOrder::setQuantity(int newQuantity) {
    quantity = newQuantity;
}

double ProductOrder::getTotal() {
    return quantity * prod.getPrice();
}

void ProductOrder::showData() {
    cout << "Name: " << prod.getName()
         << "\nPrice: "
         << prod.getPrice()
         << "\nQuantity: " << quantity
         << "\nTotal Amount: "
         << getTotal() << "\n";
}

