1. Write a Python program to: ask the user to enter the price of an item. Note: use a while loop to check the validity of the price and, if the user enters a price less than or equal to zero, to...


1. Write a Python program to: ask the user to enter the price of an item. Note: use a while<br>loop to check the validity of the price and, if the user enters a price less than or equal to<br>zero, to prompt for a valid price. Prompt the user for the quantity being purchased. If the<br>quantity is ten or greater, apply a discount of 5 percent. (.95*price*quantity).<br>Print a message that includes the price of the item, the quantity being purchased, and the<br>total price after any discount is applied.<br>Test your program's logic by running it multiple times. i.e. enter a non-positive value for<br>price; enter a positive value for price; enter a quantity of 9, 10, and 11. Include in your HW<br>PDF document screen shots of your program code file and of the output of your testing of<br>the logic.<br>

Extracted text: 1. Write a Python program to: ask the user to enter the price of an item. Note: use a while loop to check the validity of the price and, if the user enters a price less than or equal to zero, to prompt for a valid price. Prompt the user for the quantity being purchased. If the quantity is ten or greater, apply a discount of 5 percent. (.95*price*quantity). Print a message that includes the price of the item, the quantity being purchased, and the total price after any discount is applied. Test your program's logic by running it multiple times. i.e. enter a non-positive value for price; enter a positive value for price; enter a quantity of 9, 10, and 11. Include in your HW PDF document screen shots of your program code file and of the output of your testing of the logic.

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here