Your Perfect Assignment is Just a Click Away

Starting at $8.00 per Page

100% Original, Plagiarism Free, Customized to Your instructions!

glass
pen
clip
papers
heaphones

CSCI 105 Ivy Tech Community College of Indiana Change Maker Python Code Paper

CSCI 105 Ivy Tech Community College of Indiana Change Maker Python Code Paper

Question Description

Hi, I need help with my python code here. I’ve created a code that calculates changes after purchase but need help with some other things to enhance the program. There are many ways to extend this. Think about turning it into a vending machine with an inventory, objects with different prices, and different kinds of coin or bill inputs. Or think about the data structure. If you know something about arrays, you might be able to improve this program so it runs cleanly in a loop and you don’t have to write the same code over and over. You might also convert a value to another currency and return the appropriate bills and coins in that currency. here’s my code:

#ask user to input an amount of how much they purchased

price = input(“What is the amount of your purchase?”)

#ask user to input an amount of how much cash they tendered

tendered = input(“How much cash are you tendering?”)

#equation to get the change

change = float(tendered) – float(price)

#round the change to 2 decimal place

change = round(change,2)

#use if statment. change greater than 0

if change >= 0:

#print the change amount

print(“Your change is {}” .format(change))

#multiply the change by 100

change = change*100

#set the change obtain as int

change = int(change)

#gives the number of bills to give

twenty = change//2000

#use if statement. twenty greater than 0

if twenty > 0:

change = change – (twenty*2000)

#gives the number of bills to give

ten = change//1000

#use if statement. ten greater than 0

if ten > 0:

change = change – (ten*1000)

#gives the number of bills to give

five = change//500

#use if statement. five greater than 0

if five > 0:

change = change – (five*500)

#gives the number of bills to give

dollar = change//100

#use if statement. dollar greater than 0

if dollar > 0:

change = change – (dollar*100)

#gives the number of bills to give

quarter = change//25

#use if statement. quarter greater than 0

if quarter > 0:

change = change – (quarter*25)

#gives the number of bills to give

dime = change//10

#use if statement. dime greater than 0

if dime > 0:

change = change – (dime*10)

#gives the number of bills to give

nickel = change//5

#use if statement. nickel greater than 0

if nickel > 0:

change = change – (nickel*5)

#gives the number of bills to give

penny = change//1

#use if statement. penny greater than 0

if penny > 0:

change = change – (penny*1)

#print the number of bills to give

print(“Twenties: {}” .format(twenty))

#print the number of bills to give

print(“Tens: {}” .format(ten))

#print the number of bills to give

print(“Fives: {}” .format(five))

#print the number of bills to give

print(“Dollars: {}” .format(dollar))

#print the number of coins to give

print(“Quarters: {}” .format(quarter))

#print the number of coins to give

print(“Dimes: {}” .format(dime))

#print the number of coins to give

print(“Nickels: {}” .format(nickel))

#print the number of coins to give

print(“Pennies: {}” .format(penny))

#use the else statement for what the program should do if any of the above is not true

else:

#print the amount is not right

print(“Insufficient amount entered!”)


"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.