Program Name: Lab 3 # Date written: 9/16/2022 Created to fulfill requirments for CoSC 1336, Sec. 014, Fall 2022 Programe Summary: Enter number of packages purchased, get the Total Amount and Discount Data Dictionary Name: Enter number of packages purchased Author: Cory Morris Location: c:\python\ a = 1 #amount budgeted for the month amountbudget = float (input ("Enter amount budgeted for the month: ")) total = 0.0 String: Message String [A - 2] [1-151] while a == 1: b-float (input ("Enter an amount spent (0 to quit): ")) if (b== 0): a=0 else: total = total + b print ("amountbudget: $" + str (amountbudget)) print ("amountspent: $" + str (total)) if (amountbudget > total): print("s" + str (amountbudget-total) +"under budget WELL DONE!") elif (amountbudget < total): print("s" + str (total- amountbudget) +"over budget PLAN BETTER NEXT TIME!,.21¹") else: print ("The amount budget is the same as the amount spent WELL DONE!") IDLE Shell 3.10.6 File Edit Shell Debug Options Window Help amountbudget: $500.0 amountspent: $948.95 you are $448.95000000000005over budget PLAN BETTER NEXT TIME! >>> >>> >>> >>> Enter amount budgeted for the month:500 Enter an amount spent (0 to quit): 50 Enter an amount spent (0 to quit):75 Enter an amount spent (0 to quit):800 Enter an amount spent (0 to quit):23.95 Enter an amount spent (0 to quit):0 amountbudget: $500.0 amountspent: $948.95 = RESTART: C:\Users\CoryM_h7vhvbi\AppData\Local\Programs\Python\Python310\Morris lab4.py $448.95000000000005over budget PLAN BETTER NEXT TIME! = RESTART: lab4.py Enter amount budgeted for the month:500 Enter an amount spent (0 to quit):50 Enter an amount spent (0 to quit):75 Enter an amount spent (0 to quit):822 Enter an amount spent (0 to quit):23.95 Enter an amount spent (0 to quit):0 amountbudget: $500.0 amountspent: $970.95 C:\Users\CoryM_h7vhvbi\AppData\Local\Programs\Python\Python310\Morris 0 Enter amount budgeted for the month:500 Enter an amount spent (0 to quit):50 X $470.95000000000005over budget PLAN BETTER NEXT TIME!,.2f = RESTART: C:\Users\CoryM_h7vhvbi\AppData\Local\Programs\Python\Python310\Morris lab4.py Enter an amount spent (0 to quit):75 Enter an amount spent (0 to quit):800 Enter an amount spent (0 to quit):23.95 Enter an amount spent (0 to quit):0 amountbudget: $500.0 amountspent: $948.95 $448.95000000000005over budget PLAN BETTER NEXT TIME!,.2f' Ln: 189 Col: 0
Program Name: Lab 3 # Date written: 9/16/2022 Created to fulfill requirments for CoSC 1336, Sec. 014, Fall 2022 Programe Summary: Enter number of packages purchased, get the Total Amount and Discount Data Dictionary Name: Enter number of packages purchased Author: Cory Morris Location: c:\python\ a = 1 #amount budgeted for the month amountbudget = float (input ("Enter amount budgeted for the month: ")) total = 0.0 String: Message String [A - 2] [1-151] while a == 1: b-float (input ("Enter an amount spent (0 to quit): ")) if (b== 0): a=0 else: total = total + b print ("amountbudget: $" + str (amountbudget)) print ("amountspent: $" + str (total)) if (amountbudget > total): print("s" + str (amountbudget-total) +"under budget WELL DONE!") elif (amountbudget < total): print("s" + str (total- amountbudget) +"over budget PLAN BETTER NEXT TIME!,.21¹") else: print ("The amount budget is the same as the amount spent WELL DONE!") IDLE Shell 3.10.6 File Edit Shell Debug Options Window Help amountbudget: $500.0 amountspent: $948.95 you are $448.95000000000005over budget PLAN BETTER NEXT TIME! >>> >>> >>> >>> Enter amount budgeted for the month:500 Enter an amount spent (0 to quit): 50 Enter an amount spent (0 to quit):75 Enter an amount spent (0 to quit):800 Enter an amount spent (0 to quit):23.95 Enter an amount spent (0 to quit):0 amountbudget: $500.0 amountspent: $948.95 = RESTART: C:\Users\CoryM_h7vhvbi\AppData\Local\Programs\Python\Python310\Morris lab4.py $448.95000000000005over budget PLAN BETTER NEXT TIME! = RESTART: lab4.py Enter amount budgeted for the month:500 Enter an amount spent (0 to quit):50 Enter an amount spent (0 to quit):75 Enter an amount spent (0 to quit):822 Enter an amount spent (0 to quit):23.95 Enter an amount spent (0 to quit):0 amountbudget: $500.0 amountspent: $970.95 C:\Users\CoryM_h7vhvbi\AppData\Local\Programs\Python\Python310\Morris 0 Enter amount budgeted for the month:500 Enter an amount spent (0 to quit):50 X $470.95000000000005over budget PLAN BETTER NEXT TIME!,.2f = RESTART: C:\Users\CoryM_h7vhvbi\AppData\Local\Programs\Python\Python310\Morris lab4.py Enter an amount spent (0 to quit):75 Enter an amount spent (0 to quit):800 Enter an amount spent (0 to quit):23.95 Enter an amount spent (0 to quit):0 amountbudget: $500.0 amountspent: $948.95 $448.95000000000005over budget PLAN BETTER NEXT TIME!,.2f' Ln: 189 Col: 0
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
How should this flow chart look
Expert Solution
Step 1
The flowchart for the program is given in the next step
Happy to help you ?
Step by step
Solved in 2 steps with 1 images