Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

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. 2. Design a flowchart and a program for the following algorithm: input from the clerk the name of the customer, the current balance, and the amount of the deposit. Calculate a total which equals current balance plus the amount of the deposit. Use "if/elif to carry out the following steps: * If the total amount is greater than $50,000, print an interest rate of 5% and the new total after the interest rate is applied. If the total is not greater than $50,000 but is greater than $10,000, print an interest rate of 2% and the new total after the interest rate is applied. Otherwise print an interest rate of 1% and the new total after the interest rate is applied. 2.a Create the flowchart that describes the program: 2.b. Write the program code 2.c Test the logic by running the program 3 times, using totals that yield each of the three interest rates

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Publishing With Filemaker Pro On The Web

Authors: Maria Langer

1st Edition

0201696657, 978-0201696653

More Books

Students also viewed these Databases questions