Good programming style:
- Header (Description, author’s name, date and python version)
- Imports
- Functions definitions
- Driver (#main)
- Proper exit of the program with a message
- Input/output as comment
NOTE: Have a comment with “main” in it to indicate the beginning of instructions execution
A mail-order house sells five products whose retail prices are as follows: Product 1, $2.98, Product 2, $4.50, Product 3, $9.98, Product 4, $4.49, Product 5, $6.87.
Write a python program MailOrder_YI.py that reads a series of pairs of numbers as follows:
a) Product number;
b) Quantity sold.
Your program should use functions and good programming practices. It should calculate and display the total retail value of all products sold. Use a sentinel-controlled (like “yesNo”) loop to determine when the program should stop looping and display the final results.
Sample output:
Welcome to Mrs. “Elia’s Mail Order Clearing House”
Product 1, $2.98
Product 2, $4.50
Product 3, $9.98
Product 4, $4.49
Product 5, $6.87
Product number?: 1
Quantity?: 2
Do you want to continue?(yes/no): yes
Product number?: 2
Quantity?: 5
Do you want to continue?(yes/no): yes
Product number?: 3
Quantity?: 3
Do you want to continue?(yes/no): yes
Product number?: 4
Quantity?: 1
Do you want to continue?(yes/no): no
Total Price: $62
An example of a program outline Draft
#### Documentation #### imports #### #### function definitions #### maybe welcome function definitions #### maybe product and quantity function definitions with other features #### maybe tally function definitions #### exit/goodbye function definitions #### #### main #### ## call welcome function with prompt for input ## call function(s) with arguments from the welcome function ## call tally function? ## call exit function #### ## output: shopper activity ####