Debugging Create Function in Database
Showing my understanding of objects in my OOP Database
4.a Debugging with Objects
Database= a shopping list for users to add food items they wish to purchase, their price, desired quantity, and store they want to buy from.
- link to notebook (database code at bottom)
- debugging with key objects: showing create function:
Above are the attributes that each object has in my database schema. Each one of these attributes, such as quantity, item, price, or store name, has its own column in the database.
This image above shows me entering attributes when creating a new item from the menu. I entered c, which brought me to the create function that is defined above. As I step into these inputs and enter attributes for this new item, they are being initialized as shown in the top left corner.
Once I am finished creating my new item and the function call is completed by printing “Item created: “, I am directed back to the menu where I can start a new CRUD operation.
-
Above is my database before I created the new object above.
Above is the result of my new item being created in my database. The new item is “Flour” as you can see above.