This was a school assignment to create an Amazon-like storefront with MySQL. The app takes in orders from customers and depletes stock from the store's inventory.
-
Running this application will first display all of the items available for sale. Include the ids, names, and prices of products for sale.
-
The app then prompts users with two messages:
- The first asks them the ID of the product they would like to buy.
- The second message asks how many units of the product they would like to buy.
-
Once the customer has placed the order, the application checks if the store has enough of the product to meet the customer's request.
-
If not, the app prevents the order from going through.
-
However, if the store does have enough of the product, the customer's order is fulfilled.
- The SQL database is updated to reflect the remaining quantity.
- Once the update goes through, the customer is shown the total cost of their purchase.
-
The customer is then asked if they would like to shop again, which prompts the app to run again, or quit.