Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Python COMPIT105s2Lab2 EXERCISE2 Samantha owns a small business, and she calculates the retail price of her products with the following formula: Retail price wholesale
Using Python
COMPIT105s2Lab2 EXERCISE2 Samantha owns a small business, and she calculates the retail price of her products with the following formula: Retail price wholesale cost 2.5 She is using the following program to calculate retail prices: File Edit Format Run Options Window Help This pzogram calculates retail prices mark-up-2.5 # The markup percentage another " "y" # variable to control the loop # Process one or more items while anotherox another # Get the item's wholesale co5t wholesale float (input ("Enter the item's"+ wholesale cost: ")) # Calculate the retail p:ice retail-wholesale mark up # Display the retail price. print ( "Retail price : S" , format ( retail, . , . 2 ), sep ) # Do this again? another-input(Do you have another item? (Enter y for yes)' Some of the items have a wholesale cost such as S0.25 and sometimes she makes typing mistake; she types -0.25, instead of 0.25 (note 0 is close to-on KB) Your task is to modify the program so it will not allow a negative number to be entered for the wholesale cost. When she types-0.25 your improved program should print something like Enter the item's wholesale cost:-0.25 ERROR: the cost cannot be negative Enter the crrect wholesale cost :0.25 Retail price: 0.62 Do you have another item? (Enter y for yes): | Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started