What’s My Change?

my-change

Your Challenge


Using either Python or HTML + JavaScript, write a program that prompts the end-user to enter two values:

  • Value 1: Amount to be paid by the customer
  • Value 2: Amount received from the customer

The program should then find out how many banknotes or coins of different values should be returned.
what-s-my-change

Tip:


Your program will accept banknotes of £20, £10 and £5 and the following coins: £2, £1, 50p, 20p, 10p, 5p, 2p, 1p.

Extension:


Add some validation rules to ensure that the user has entered valid currency values. You should also check that the amount received from the customer is greater or equal to the amount to be paid.

Share Button
Posted in Computer Science, JavaScript, Python - Intermediate, Python Challenges Tagged with: ,

Our Latest Book

Follow this blog