Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Geekware Software Company s biggest seller software package sells for $ 1 4 9 each. Quantity discounts are given according to the following table: Quantity
Geekware Software Companys biggest seller software package sells for $ each. Quantity discounts are given according to the following table:
Quantity Discount
None
or more
Goal:
Write a program that asks the user to enter the number of packages purchased. If the number entered is valid not negative and not zero the program should then display the dollar amount of the discount if any and the total amount of the purchase after discount.
Design:
You will be using a flow chart to design your program.
Input Validation:
The number of packages entered by the user must not be negative or zero. If the user inputs a fractional number, the code should convert it to a whole number.
Output and Sample Dialog:
If an invalid number of packages is entered, the message Invalid
number of packages! must be shown and the program should terminate. Otherwise, your program
should use Fstrings to produce correctly labeled output with dollar
amounts rounded to two decimal places and dollar signs displayed
Enter the number of packages purchased:
Discount amount: $
Total after discount: $
Requirements:
Use named constants for all number values that will not be changed in the program
Use Fstrings
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