Write a program
Learning Goal: I’m working on a python project and need support to help me learn.
Write a program to request the purchase price of an item and the selling price of an item. The program is to give output of price increase of the item, percent increase of the item and profit margin of the item. This is figured by:
- PRICE INCREASE = ITEM SELLING PRICE – ITEM PURCHASE PRICE
- PERCENT INCREASE = PRICE INCREASE ÷ ITEM PURCHASE PRICE
- PROFIT MARGIN = PRICE INCREASE ÷ ITEM SELLING PRICE
Make sure you correctly declare and initialize to their NULL value all variables (use naming convention of variables as we learned in class).
When prompting the user make sure it is clear to the user how they are to enter the input (you can use a print message statement prior to the prompt to clarify input) and use exception handling to ensure correct data input. Also, make sure your prompt is clear of spelling and grammar errors.
The output for price increase should show the dollar sign and be taken to 2 decimal places. The output for percent increase and profit margin should be shown as a percent and taken to 1 decimal place.
The program should have appropriate comments (thus there should be a comment for the program, section comments for variable declaration, input, processing and output and line comments for code that may not be clear to others who look at the program.