Make Change

FYI

The purpose of this project is to create code that calculates the minimum number of bills and coins.

Project #1

In this project the user will be given an amount of change to return to a customer.

Create an interactive program to

  1. generate a random amount to return (between $599.99 and $0.00)
  2. calculate the fewest number of bills and coins for the amount
  3. display the number of bills and coins available to the user
  4. loop
    1. ask the user for the fewest number of bills and coins for the amount
    2. if the user is correct, give them an ATTABOY
    3. if not correct, display an error message
    4. display the correct answer and their answer
      • display a table built with f strings?
      • do not display bills and coins that are not used?

The Number of Bills and Coins
BillsNumber of Bills CoinsNumber of Coins
$100Unlimited 50¢Unlimited
$50Unlimited 25¢Unlimited
$20Unlimited 10¢Unlimited
$10Unlimited Unlimited
$5Unlimited unlimited
$1Unlimited   

Develop using a menu first, then convert to a GUI?

See PySimpleGUI or PyQt. (Note: There are other Python GUI toolkits.)

Project #2

The same as Project #1, except with a limited number of bills and coins.

The Number of Bills and Coins
BillsNumber of Bills CoinsNumber of Coins
$1003 50¢6
$504 25¢5
$208 10¢7
$102 4
$54 4
$15   

This is a list of bills and coins to start with. The next step is to generate the number of bills and coins randomly (within limits).

Project #3

Same as project #1 except use "Old English" money.

When entering or displaying money use these symbols (£), (s), and (d). If your keyboard/display does not have a (£) character, substitute (x).

Also display the money using the descriptive names shown below.

From Old English Money

Before decimalization on 15 February 1971, there were twenty (20) shillings per pound (£).

The shilling was subdivided into twelve (12) pennies.

The penny was further sub-divided into two halfpennies or four farthings (quarter pennies).

    2 farthings             = 1 halfpenny (1/4d)
    2 halfpence             = 1 penny (1d)
    3 pence                 = 1 thruppence (3d)
    6 pence                 = 1 sixpence  (6d)
    12 pence                = 1 shilling (a bob) (1s)
    2 shillings             = 1 florin ( a 'two bob bit') (2s)
    2 shillings and 6 pence = 1 half crown (2s 6d)
    5 shillings             = 1 Crown (5s)

The symbols 's' for shilling and 'd' for pence derive from the Latin solidus and denarius used in the Middle Ages.

The the symbol for pound '£' developed from the 'l' for libra.

A 1£ coin was called a Sovereign and was made of gold. A paper pound often was called a quid.

1 guinea = one pound and one shilling = 21 shillings. 1 guinea could be written as '1g' or '1gn'.

"Bob" is slang for shilling.