
Can you annotate and create a flowchart for this code.
Provide description outlining which option chosen to write the code and a description of how it works and how to use it.
Can you also check this code for syntax errors. I want it written in python.
flag = 0
while flag == 0 :
cost = float(input("Enter the cost: "))
amount = float(input("Enter the amount given(should be greater than cost): "))
if amount < cost :
print("Amount should be greater than cost.")
else:
flag = 1
change = amount-cost
print(f"The change to be given is ${change}")
twenty=0
ten=0
five=0
single=0
quarter=0
dime=0
nickel=0
penny=0
while change>=20 :
twenty+=1 #incrementing twenty until change is greater than or equal to 20
change-=20 #decrementing 20 from change
while change>=10 :
ten+=1#doing the above operation for all possible dollar bills
change-=10
while change>=5:
five+=1
change-=5
while change>=1:
single+=1
change-=1
while change>=0.25:
quarter+=1
change-=0.25
while change>=0.10:
dime+=1
change-=0.10
while change>=0.05:
nickel+=1
change-=0.05
while change>=0: #Checking with 0 to counter precision
penny+=1
change-=0.01
#Displaying the results
print(f"For that you require the following:")
print(f"Twenty dollar bills: {twenty}")
print(f"Ten dollar bills: {ten}")
print(f"Five dollar bills: {five}")
print(f"Single dollar bills: {single}")
print(f"Quarter dollar bills: {quarter}")
print(f"Dime dollar bills: {dime}")
print(f"Nickle dollar bills: {nickel}")
print(f"Penny dollar bills: {penny}")

Trending nowThis is a popular solution!
Step by stepSolved in 6 steps with 7 images

- Create a Raptor flowchart and name the file Software Discountslname where Iname is YOUR last name. Here is the problem to solve: A software company sells a package that retails for $99. Quantity discounts are given according to the following table: Quantity Discount 10-19 20% 20-99 30% 100 or more 40% Use the flowchart on the next page as a guide. You will need to fill in the conditions or Boolean expressions in the selection structures, using the variables that are indicated in the model on the next page. Do not add any variables. Fill in the missing assignment statements in the selection structures. Last, fill in the three assignment boxes to calculate: 1) the amount the customer owes before the discount (quantity times the price of one software package) 2) the amount of the discount (you've already calculated the discountRate in the selection structure) and 3) the amount the customer owes after the discount is applied Output the information to the user. Test your program 4 times,…arrow_forwardi am after a python Graphical User Interface (GUI) for the question shown in the image: the GUI must implement the following code: #creating function def account(): # taking input for amount deposited 'p' p = int(input('Enter number of deposited amount:$')) # taking input for stated interest rate 'r' r = float(input(' Enter stated interest rate: ')) # taking input for coumpounding interest 'm' m = int(input(' Enter compounding interest: ')) # Now calculating account balance account_balance = p*(1+(r/m))**m print(account_balance) # Now calculating Annual percentage yield (APY) APY = (1+(r/m)**m)-1 # if in case account balance comes greater than 1000$ than it will calculate APY if account_balance > 1000: print(APY) account() as well as it must have all these: Use the Grid element• Add Label elements throughout your GUI.• Use the Background Colour property.• Allow a user to select choices from an either list box, drop-down menu, or scroll-down menuelement. Allow a user to input…arrow_forward"Develop a Java function named display_album_info that prints details about an album titled 'Euphoric Symphony. The function should output the following information: Artist's name and release year. Brief description of the album's theme or concept. Tracklist with song titles and durations. Musical genre and target audience. Average rating on a scale of 1 to 5. Memorable lyrics or standout musical moments. Contact information for inquiries (email: music@euphoricsymphony.com, phone: 555-4321). Call the function to display the album information."arrow_forward
- could you provide a flowgorithm chart so I can see the specific variables declared and assignedarrow_forwardplease look at the screenshot instructions to help me create a flowchart of this c++ code ,also you dont need to do the other tasks just help me to create a flowchart regarding the instructions given, thank youarrow_forwardPLEASE USE FLOWGORITHM.Design a program for Jones College. The current tuition is $12,000 per year, and tuition is expected to increase by 5 percent each year. Display the tuition amount for each year over the next five years (use a looping structure) and also the total tuition at the end of the program. Hint: You will need to use two assignment statements for calculating purposes. One will be an accumulating total assignment statement.arrow_forward
- Specification You must write a script that prints a table of inches and their cquivalent centimcter values. You convert inches to centimeters using the formula cm = inches * 2.54 Centimeter values must be integers. At the top of the table should appear the labels "Inches" and "Centimeters", Under these labels should be a line of dashes. The centimeter values should align with the "Centimeters" label. In other words, it will work in exactly the same way as But it will do this in a different way. The script will create the table using 3 functions which you must write. • print_conversion_table • print_table_header • print_table_line These functions will be called using test code which you will find below. print_conversion_table This function must have the following header def print_conversion_table(min, max): This function will will print the conversion table. It will call print_table_header to print the labels at the top of the table. It will use a for loop to call print_line to print…arrow_forwardCan you annotate and create a flowchart. Can you also give description outlining which option chosen and a description of how it works and how to use it. def decimalToBinary(dec): if dec==0: return '' else: return decimalToBinary(dec//2) + str(dec%2) def DecimaltoHex(n): x = (n % 16) characters = "0123456789ABCDEF" rest = n // 16 if (rest == 0): return characters[x] return DecimaltoHex(rest) + characters[x] n = eval(input('Enter a decimal integer: ')) print("Binary: ", decimalToBinary(n)) print("Hexadecimal: ", DecimaltoHex(n))arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





