program called pricechg.py that enables the user to change the price of a product in the database.
Question:
program called pricechg.py that enables the user to change the price of a product in the database.
Your program should: • Include a comment in the first line with your name.
• Include comments describing each major section of code.
• Connect to the DBVac database file (dbvac_sqlite.db).
• Ask the user to input a two-letter Model ID. o 1 point Extra Credit: Validate that what the user entered was two characters long. If not, then have the user re-enter the abbreviation until it's two characters long.
o 1 point Extra Credit: Also validate that the two-letter Model ID value exists in the database.
• Ask the user to input the new price for the product.
o Validate that the new price is a float (Hint: validation for a float also accepts integer values.)
o 1 point Extra Credit: Validate that the value entered was positive. If not, keep asking the user to enter a value until they enter a value above 0.
• For the Model ID entered and before actually updating the database, query the database via Python to get the product name and current price of the product.
• Then, before updating the database, tell the user what the product name and current price are as well as what the price would be if the update occurs. Then, ask the user to enter "y" if they really want to make the update or "n" if not.
o Validate that they have entered either y or n. If not, keep asking until they enter one or the other.
o If they answer "n", tell the user that the change was not made (at which point the program ends).
• If they enter "y", update the database to change the price for the product.
• After updating the database, allow the user to see that the change was made by querying the database with a SELECT statement in Python, then output the Model ID, Product Name, MSRP, and Product Type.
Management Accounting Information for Decision-Making and Strategy Execution
ISBN: 978-0137024971
6th Edition
Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young