Write a python program that asks a user (business owner) for their product information and creates an electronic list (e-list) of items. Your program should start by asking the business owner’s name (string) and the name of the company (string). Next, it should ask for three (3) product names (strings), their unit prices (floats), and the total number of products in stock (ints). Finally, it should display the list of items. Below is a sample run of the program that demonstrates how your output could look (user input is boldened for emphasis): Sample output (user input is boldened for emphasize): Please enter your name >> Bond Hi Bond, please enter your company name >> Mart 007 Let's set up a sales menu for 'Mart 007'. Enter item 1's name >> Spiked Umbrella Enter item 1's unit price >> 7.25 Enter item 1's quantity >> 5 Enter item 2's name >> Voice Changer Enter item 2's unit price >> 5.5 Enter item 2's quantity >> 10 Enter item 3's name >> Spy Camera Enter item 3's unit price >> fifteen Price must be a number. Please enter again >> -15 Price must be positive. Please enter again >> 15 Enter item 3's quantity >> eight Stock must be a number. Please enter again >> -8 Stock must be positive. Please enter again >> 8 Great! Here is the e-list for Mart 007. ------------------ Welcome ------------------ ============================================= Please select the item you want to buy from the following menu: 1. Spiked Umbrella ($7.25 each), 5 available 2. Voice Changer ($5.5 each), 10 available 3. Spy Camera ($15.0 each), 8 available Press 4 when you are done! ============================================= Note: users are always allowed to enter any type of data when asked for input. Your program must always verify the user input. Invalid input should be handled with suitable error messages for each type of invalid input and the prompt should be repeated. Hint: you may want to use while loops to validate user inputs, i.e., rep
Write a python program that asks a user (business owner) for their product information and creates an electronic list (e-list) of items.
Your program should start by asking the business owner’s name (string) and the name of the company (string). Next, it should ask for three (3) product names (strings), their unit prices (floats), and the total number of products in stock (ints). Finally, it should display the list of items.
Below is a sample run of the program that demonstrates how your output could look (user input is boldened for emphasis):
Sample output (user input is boldened for emphasize):
Please enter your name >> Bond
Hi Bond, please enter your company name >> Mart 007
Let's set up a sales menu for 'Mart 007'.
Enter item 1's name >> Spiked Umbrella
Enter item 1's unit price >> 7.25
Enter item 1's quantity >> 5
Enter item 2's name >> Voice Changer
Enter item 2's unit price >> 5.5
Enter item 2's quantity >> 10
Enter item 3's name >> Spy Camera
Enter item 3's unit price >> fifteen
Price must be a number. Please enter again >> -15
Price must be positive. Please enter again >> 15
Enter item 3's quantity >> eight
Stock must be a number. Please enter again >> -8
Stock must be positive. Please enter again >> 8
Great! Here is the e-list for Mart 007.
------------------ Welcome ------------------ =============================================
Please select the item you want to buy from the following menu:
1. Spiked Umbrella ($7.25 each), 5 available
2. Voice Changer ($5.5 each), 10 available
3. Spy Camera ($15.0 each), 8 available
Press 4 when you are done! =============================================
Note: users are always allowed to enter any type of data when asked for input. Your program must always verify the user input. Invalid input should be handled with suitable error messages for each type of invalid input and the prompt should be repeated.
Hint: you may want to use while loops to validate user inputs, i.e., repeat the loop until the user enters the correct (type of) input.
Step by step
Solved in 3 steps