Pseudo Code Library |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Shoe Cost CalculatorYou are creating a program for a new company, Diamond Geezer Shoes, which sells hand made trainers which are encrusted with diamonds. They are aiming to make this an expensive high fashion choice, which means that they have very specific ideas on who they would like to market their shoes to. The shoes come in sizes from 7 to 13, and have a basic cost of £1000 per pair. The number of diamonds needed obviously depends on the size of the shoe, so there is an additional cost of £200 for every shoe size over 7. So for example a pair of shoes in size 10 will cost £1000 + £200 * 3 (the difference between 10 and 7), = £1000 + £600 = £1600. The idea is to associate the diamond shoes with self-made wealthy people aged between 25 and 40. They don't want people without their own independent wealth to wear them, so they won't sell them to people under 20, as these people aren't old enough to have made their own money, and are probably getting them as a gift. They will grudgingly sell them to the over 40s, but the price goes up by a sliding scale of 1.5 * the cost for the 40-50 age group, or double the cost if over 50. So for example, the size 10 pair of shoes for someone aged 20 to 40 is £1600. Someone aged 19 can't buy them. Someone aged between 41 and 50 pays 1.5 * £1600 = £2400. Someone aged 51 or over pages 2 * £1600 = £3200. In summary:
Your program should
Flowchart for the program![]() TestingYou will need to plan how to test your program. Write the test plan BEFORE you do the code, and work out what the cost of the shoes should be by hand.
ExtensionThe owner of the company, Mr Gerald Cobbler, is interested in alternative and ancient religions, and firmly believes is the principle of Nominative Determinism. He has develped these ideas and become convinced that anyone whose name contains all 5 vowels would provide excellent celebrity marketing for the shoes, and should get them for free. Adapt the program so that if the customer name contains all of the letters A,E,I,O,U, they get their shoes free. You can test it with the name of the famous Italian philosopher, rock star and sports car designer, Anton DiLeachou. |