Lab07: Create a Python source file called Lab07.py that asks for prices of items, -1 for...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Lab07: Create a Python source file called "Lab07.py" that asks for prices of items, -1 for the subtotal, or 0 for the total. When the price 0 is entered, the program will output the total, and then present a menu of coupon options: 0: No discount, 1: 5%, 2: 10%, 3: 15%, and 4: 20% off the total. Any other menu choice is to be rejected and asked for again. The program will then calculate the total reflecting any coupon discount, and then apply the appropriate sales tax (6%), and print out the total. Your output should be formatted exactly as the sample output below. You can use "\t" to tab and align your output, and the format() function to display two decimals. For the font colors and styles to work, you will need to run your program in Thonny and add the following import code: import colorama from colorama import Fore, Back, Style Sample output: >>> %Run Lab07.py Enter prices: or -1 for Subtotal or 0 for Total: Subtotal: Enter prices: or -1 for Subtotal or 0 for Total: Subtotal: Enter prices: or -1 for Subtotal or 0 for Total: Total: Coupon Menu: 0: No Discount 1: 5% Discount 2: 10% Discount 3: 15% Discount 4: 20% Discount Coupon choice: 5% Discount: Subtotal After Disc: Sales Tax: Final Total: $ 1.23 $5 $ 89.15 $ -1 ‒‒‒‒‒‒‒ 95.38 $.90 $-1 $ 96.20 $0 $96.28 5 Invalid. Enter coupon menu option: 1 $ 4.81 $ 91.47 $ 5.49 ‒‒‒‒‒‒ $96.95 Lab07: Create a Python source file called "Lab07.py" that asks for prices of items, -1 for the subtotal, or 0 for the total. When the price 0 is entered, the program will output the total, and then present a menu of coupon options: 0: No discount, 1: 5%, 2: 10%, 3: 15%, and 4: 20% off the total. Any other menu choice is to be rejected and asked for again. The program will then calculate the total reflecting any coupon discount, and then apply the appropriate sales tax (6%), and print out the total. Your output should be formatted exactly as the sample output below. You can use "\t" to tab and align your output, and the format() function to display two decimals. For the font colors and styles to work, you will need to run your program in Thonny and add the following import code: import colorama from colorama import Fore, Back, Style Sample output: >>> %Run Lab07.py Enter prices: or -1 for Subtotal or 0 for Total: Subtotal: Enter prices: or -1 for Subtotal or 0 for Total: Subtotal: Enter prices: or -1 for Subtotal or 0 for Total: Total: Coupon Menu: 0: No Discount 1: 5% Discount 2: 10% Discount 3: 15% Discount 4: 20% Discount Coupon choice: 5% Discount: Subtotal After Disc: Sales Tax: Final Total: $ 1.23 $5 $ 89.15 $ -1 ‒‒‒‒‒‒‒ 95.38 $.90 $-1 $ 96.20 $0 $96.28 5 Invalid. Enter coupon menu option: 1 $ 4.81 $ 91.47 $ 5.49 ‒‒‒‒‒‒ $96.95
Expert Answer:
Answer rating: 100% (QA)
I have provided PYTHON CODE along with CODE SCREENSHOT ... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
Ivanhoe Company uses a job order cost system in each of its three manufacturing departments. Manufacturing overhead is applied to jobs on the basis of direct labor cost in Department D , direct labor...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
On 31 March 1980, Philip acquired a 48-year copyright at a cost of 85,000. The copyright was valued at 92,000 on 31 March 1982. On 31 March 2021, Philip sold the copyright for 47,000. Compute the...
-
If the speed of a car is increased by 50% by what factor will its minimum braking distance be increased, assuming all else is the same? Ignore the drivers reaction time.
-
When human vocal cords are used to sing falsetto , the result is a very pure sound, relatively free of overtones. Assume two singers are singing falsetto, attempting to produce a note with frequency...
-
An advanced engineering computer was purchased for $\$ 22,750$ and its expected life is 4 years. It is estimated the company could sell the computer for $\$ 500$ after 5 years. Compute and compare...
-
A radioactive material produces 1280 decays per minute at one time, and 4.6h later produces 320 decays per minute. What is its half-life?
-
Image transcription text Task.2b-is-the-capacitor-discharging-below. Current 1 Voltage 0 -1 171 172 173 174 -2 -5 . 50 51 52 53 54 (s) Simulation time (s) Simulation time 0.00 5.6 kS 100 UF HAL 10.0...
-
You are considering buying gifts for a pair of friends. Both truly enjoy video gaming. However, both have reduced their budget on these items because of the temptation that they can cause. Dana is...
-
When an asset is sold, the undepreciated capital cost in its asset class (or pool) is reduced by what is realized on the asset or by its original cost, whichever is less. This amount is called the?
-
Looking independently at each of the economic observations below, indicate the country where an analyst would expect to see a strengthening currency for each observation. Expected inflation over next...
-
Marcus begins trading on 1 January 2016 and has the following results: (a) Compute his trading income (before loss relief) for 2015-16 to 2017-18. (b) Identify the claims that could be made in...
-
Nathan begins tradi ng on 1 October 2015 , making up accounts to 31 December each year. His first two sets of accounts show the following adjusted trading losses: 2012-13 2013-14 2014-15 2015-16 (to...
-
The following table shows financial data for Costco Wholesale and Walmart, two major U.S. retailers. Assume that both companies have an average annual holding cost rate of 30 percent (i.e., it costs...
-
A food processing company is considering developing a new line of product. Depending on the quality of raw material, different yields and different quality of the final products can be expected. The...
-
, name the vertebral levels of each of the followinglandmarks: Sternal angle Xiphisternal joint Jugular notch Manubrium B. Which of these structures can you palpate onyourself? C. describe the...
-
Read the Forecasting Supply Chain Demand Starbucks Corporation case in your text Operations and Supply Chain Management on pages 484-485, then address the four questions associated with the...
-
Create a class Rational that represents a rational number. It should have private attributes for The numerator (an integer) The denominator (an integer) and the following methods: Rational(numerator,...
-
Write a static method for selection sort that will sort an array of characters.
-
What output will be produced by the following code? public class Demo { public static void main(String[] args) { System.out.println("The output is:"); foo(23); System.out.println(); } public static...
-
On December 1, 2023, Rebecca Ward, a single taxpayer, comes to you for tax advice. At the end of every year, she donates \($5,000\) to charity. She has no other itemized deductions. This year, she...
-
Kelly and Chanelle Chambers, ages 47 and 45, are married and live at 584 Thoreau Drive, Boston, MA 59483. Kellys Social Security number is 111-11-1111 and Chanelles is 222-22-2222. The Chambers have...
-
Following is a list of information for Peter and Amy Jones for the current tax year. Peter and Amy are married and have three children, Aubrynne, Bryson, and Caden. They live at 100 Main Street,...
Study smarter with the SolutionInn App