/**
 * CS-11 Asn 10
 * Store.cpp
 * Purpose: models a store.
 *
 * @author Ed Parrish
 * @version 1.2 11/03/04
 */
#include <fstream>
#include <iostream>
using namespace std;

#include "Product.cpp"

const int MAX_PRODS = 5;

class Store {
public:
    /**
     * Constructs a Store.
     */
    Store();

    /**
     * Initializes the Store data.
     *
     * @param size The maximum number of Products in this Store..
     */
    void loadProducts(int size);

    /**
     * Reports the store inventory.
     */
    void reportInventory();

    /**
     * Records the sale of a Product by decrementing the inventory.
     *
     * @param choice The index in the array of the Product sold.
     */
    void sellProduct(int index);

    /**
     * Gets a valid product selection from the user.
     *
     * @return The index in the array of the product selected.
     */
    int chooseProduct();

private:
    int numProducts;
    Product prods[MAX_PRODS];
    string fileName;
};

Store::Store() {
    cout << "Welcome to our virtual store!\n";
    fileName = "products.txt";
    loadProducts(MAX_PRODS);
}

// Read the product information from a file
void Store::loadProducts(int size) {

}

// Report the inventory of Products in the store
void Store::reportInventory() {

}

// Gets a valid product selection from the user.
int Store::chooseProduct() {
    int item = 0;
    return item;
}

// Records the sale of a Product by decrementing the inventory.
void Store::sellProduct(int item) {

}

// Program control
int main() {
    Store store;
    int choice = 1;

    while (choice != 0) {
        store.reportInventory();
        choice = store.chooseProduct();
        store.sellProduct(choice);
    }
    cout << "\nGoodbye!\n";

    return 0;
}

