Skip to content

Latest commit

 

History

History
28 lines (16 loc) · 1.67 KB

File metadata and controls

28 lines (16 loc) · 1.67 KB

Bamazon

In this activity, you'll be creating an Amazon-like storefront with the MySQL skills you learned this unit. The app will take in orders from customers and deplete stock from the store's inventory. As a bonus task, you can program your app to track product sales across your store's departments and then provide a summary of the highest-grossing departments in the store.

Running this application will first display all of the items available for sale. Including the ids, names, and prices of products for sale.

Working-App Gif

The app then prompts users with two messages.

  • The first should ask them the ID of the product they would like to buy.
  • The second message should ask how many units of the product they would like to buy.

Sufficient-Inventory

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 will log the phrase Insufficient product!, and then prevent the order from going through.

Out-of-Stock

If the store does have enough of the product, the customer's order will be fulfilled.

  • This the updates the SQL database to reflect the remaining quantity.

MySQL-Before

MySql-After

  • Once the update goes through, the customer will see the total cost of their purchase.