Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

create a change - counting game that gets the user to enter the number of coins

ID: 441694 • Letter: C

Question

create a change - counting game that gets the user to enter the number of coins required to make exactly one dollar. the program should let the user enter the number of pennies,nickels,dimes, and quarters. if the total value of the coins entered is equal to one dollar,the program should congratulate the user for winning the game,otherwise , the program should display a message indicating whether the amount entered was more than or less than one dollar. note: i want the solution in visual c#

Explanation / Answer

def monetary_value(pennyAmount, nickelAmount, dimeAmount, quarterAmount): penny1=pennyAmount * .01 nickel1=nickelAmount * .05 dime1=dimeAmount * .10 quarter1=quarterAmount * .25 dollar = penny1 + nickel1 + dime1 + quarter1 return dollar def condition1(amount1): if amount1 == 1.00: print "Congrats your coins add up to a dollar" elif amount1 < 1.00: print "Sorry your coins add up to be under a dollar" elif amount1 > 1.00: print "Sorry your coins add up to be over a dollar" def main(): # Gets the number of each coins from user pennies = input("How many pennies do you have: ") nickels = input("How many nickels do you have: ") dimes = input("How many dimes do you have: ") quarters = input("How many quarters do you have: ") variable3=monetary_value(pennies, nickels, dimes, quarters) #Variable3 will take the value of what monetary_value function returns(dollar) condition1(variable3)