> BondHi Bond, please enter your company name >> Mart 007Let's setup a sales menu for 'Mart 007'.Enter item 1's name >> Spiked UmbrellaEnter item 1's unit price >> 7.25Enter item 1's quantity >»...


Write a program called a2_q1.py that asks the user (business owner) for their product<br>information and creates an electronic list (e-list) of items. In part-2 of this assignment, customers<br>should be able to use this e-list to purchase multiple products of varying quantities while products<br>are available in stock.<br>Your program should start by asking the business owner's name (string) and the name of the<br>company (string). Next, it should ask for three (3) product names (strings), their unit prices<br>(floats), and the total number of products in stock (ints). Finally, it should display the list of items.<br>Below is a sample run of the program that demonstrates how your output could look (user input<br>is highlighted for emphasis):<br>Sample output (user input is highlighted for emphasize):<br>Please enter your name >> Bond<br>Hi Bond, please enter your company name >> Mart 007<br>Let's setup a sales menu for 'Mart 007'.<br>Enter item 1's name >> Spiked Umbrella<br>Enter item 1's unit price >> 7.25<br>Enter item 1's quantity >» 5<br>Enter item 2's name >> Voice Changer<br>Enter item 2's unit price >> 5.5<br>Enter item 2's quantity >» 10<br>Enter item 3's name >> Spy Camera<br>Enter item 3's unit price >> fifteen<br>Price must be a number. Please enter again >> -15<br>Price must be positive. Please enter again >> 15<br>Enter item 3's quantity >> eight<br>Stock must be a number. Please enter again >> -8<br>Page 4 of 10<br>

Extracted text: Write a program called a2_q1.py that asks the user (business owner) for their product information and creates an electronic list (e-list) of items. In part-2 of this assignment, customers should be able to use this e-list to purchase multiple products of varying quantities while products are available in stock. 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 highlighted for emphasis): Sample output (user input is highlighted for emphasize): Please enter your name >> Bond Hi Bond, please enter your company name >> Mart 007 Let's setup 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 Page 4 of 10
Stock must be positive. Please enter again >> 8<br>Great!<br>Here is the e-list for Mart 007.<br>Welcome<br>=========<br>Please select the item you want<br>to buy from the following menu:<br>1. Spiked Umbrella ($7.25 each), 5 available<br>2. Voice Changer ($5.5 each), 10 available<br>3. Spy Camera ($15.0 each), 8 available<br>Press 4 when you are done!<br>============<br>===========:<br>Note: users are always allowed to enter any type of data when asked for input. Your program<br>must always verify the user input. Invalid input should be handled with suitable error messages<br>for each type of invalid input and the prompt should be repeated. To keep things simple, we will<br>consider that when prompted a user can enter either an integer, a string, or a float (i.e., not a<br>combination of letters and digits).<br>Hint: you may want to use while loops to validate user inputs, i.e., repeat the loop until user<br>enters the correct (type of) input.<br>11°C A<br>近<br>

Extracted text: 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. To keep things simple, we will consider that when prompted a user can enter either an integer, a string, or a float (i.e., not a combination of letters and digits). Hint: you may want to use while loops to validate user inputs, i.e., repeat the loop until user enters the correct (type of) input. 11°C A 近
Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here