The question is: You have recently been employed by a company that specialises in application development. Your first
project is to help them design an application using Python that will help shoppers determine which
products to buy at the supermarket and price after a percentage discount is applied.
At a minimum, your application will:
1. Provide a menu asking the type of calculation needed (discount or best buy)
2. Based on the selection appropriate prompts should be presented
3. For best buy;
a. Ask for the cost of at least two products
b. Ask for the mass or quantity of the products
c. Tell the user which product is better value
4. For discount, consider a case where either the percentage discount is given, or the prices before and
after discount are given.
a. For the first case, you should ask the user for the ticket price and percentage discount then tell
the user the unit price after discount
b. For the second case, you should ask the user for the price before discount and after discount in
order to inform the user of the percentage discount
c. Finally, tell the user of the best deal
For extra credit:
You may consider adding extra functionality to the application, for example your code could:
a. Consider the quality of the product in its overall value (cheaper is not always better!)
b. Incorporate a shopping list with costing
c. Code accounts for misuse (equal value, incorrect inputs)
d. Consider using loops and prompts in order to avoid having to re-run the code to perform another
calculation. Remember to give the user the option to quit!
I m really sorry if this is too much, but my code isn t working... at all. I just have a feeling that I messed everything up.
1 answer
Since you have posted no code, it's hard to say what is wrong. Maybe you could post one routine, and explain what you want it to do. Then maybe we can check to be sure that's what it actually does. Do NOT simply drop a couple hundred lines of code here and expect someone to spend several hours figuring it out.
google is your friend. There are many online discussions and examples of how to debug code. I have no experience in Python, but I spent 40 years as a programmer, and well know the frustration and satisfaction of writing readable and working code.