It’s 30 years Oct 21.
In honor of that I made an assignment for my class:
You find an odd DeLorean parked around the corner. Realizing that Doc Brown has left the keys in the ignition, you decide that a quick trip back to England in 1815 for the purpose of buying the film rights to Pride and Prejudice, Persuasion, and Emma would be remunerative.
As usual, the car fails and you are stranded.
All is not lost, Miss Austen (or her brother Henry, a dashing naval captain) are good company and you decide to settle in for the long haul. She needs a business manager, and having few other practical skills, you volunteer. This means understanding English currency.
Fortunately, you have your laptop, with a python interpreter, and by the use of lemon juice, copper pennies and zinc you are able to rig up a battery to keep it running.
English money is denominated in pounds shillings and pence (L/s/d). There are 12 pence to the shilling and 20 shillings to the pound. Half-pence (hapennies) and quarter-pence (farthings) are used so you must handle sums like 10/4/5 3/4
- Write a python program that takes a list of money and sums them correctly.
2/18/9 should sum to 4/1/0
Leading 0’s are usually left off, so 2/6 is 2 shillings and 6 pence.
- Make it do subtraction.
– 1/2/3 1/2 should be 1/16/5 1/2