Question: This assignment requires you to implement a list of Product objects. Product details: One Constructor ( _ _ init _ _ ) It will take

This assignment requires you to implement a list of Product objects.
Product details:
One Constructor (__init__)
It will take all the parameters as listed:
int idNum
String name
Float price
int quantity
Methods that must be part of the Product class (you may and probably will add other methods):
Method Functionality
getID(self) Returns the Products ID number.
setID(self, newID) Updates the Products ID number.
getName(self) Returns the Product's name.
setName(self, newName) Updates the Product's name.
getPrice(self) Returns the Products price.
setPrice(self, newPrice) Updates the Products price.
getQuantity(self) Returns the quantity in inventory.
setQuantity(self, newQuantity ) Updates the quantity in inventory.
toString(self) Returns a printable version of the Product Object.
MyStore technical specifications:
MyStore should manage a list of product objects. Initial data about products is available in a text file named product.txt. This should be read into the list of products. The product.txt file is delimited by commas. After the list is created a loop is entered. The loop should display a menu which has the following options, obtain the number of the type of transaction from the user, and process the transaction. The loop should continue to execute until the "8" Exit option is selected from the menu. When the exit option is selected, the program should write out to a text file information about all the products in the list in the same format as the input file. The name of the output text file should be productUpdate.txt.
1. Add Product Prompt the user to enter the data required for a new product and add the product into the list of products.
2. Delete Product Have the user enter the product ID. If the product exists, prompt the user to confirm that they want the product to be deleted. If so, delete the product by moving all of the products below it in the list up one compartment and subtract one from count. Display an informative message to the user regarding the action taken.
3. Change Price Have the user enter the product ID and the new price of the product. Change the price of the product in the list if it exists, otherwise display an informative message to the user that the product does not exist.
4. Purchase Product Units Have the user enter the product ID and quantity of the product purchased. Adjust the quantity to reflect the purchase of products. Display a message for the user if the product does not exist in the list.
5. Sell Product Units Have the user enter the product ID and quantity of the product to be sold. Adjust the quantity to reflect the sale of products. Display a message for the user if the product does not exist in the list.
6. Display information about an individual product Have the user enter the ID number of the product to be displayed. Display the information if the product exists, otherwise display an information message.
7. Display information about all the products List all the products in inventory by using the toString() method.
8. Exit This will end the program execution.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!