Write a program to get change values in Quarter, Dime, Nickels and Pennies, and calculate the value of change in Dollars. Consider Quarter = 0.25 $, Dime = 0.10 $, Nickels = 0.05 $ and Penny = 0.01 $.
Code
print("Change Calculator")print("Enter the number of coins you have:")quarters = int(input("Quarters: "))dimes = int(input("Dimes: "))nickels = int(input("Nickels: "))pennies = int(input("Pennies: "))total = quarters * 0.25 + dimes * 0.10 + nickels * 0.05 + pennies * 0.01print("The total value of your change is ${}".format(total))
0 Comments
Post a Comment