Start Price List Display price list money Input

  • Slides: 2
Download presentation
Start --- Price List --Display price list money = Input “How much can you

Start --- Price List --Display price list money = Input “How much can you spend? ” A - Marshmallow: £ 0. 20 B - Bubble gum: £ 0. 30 C - Jelly Bean: £ 0. 15 D - Candy Stick: £ 0. 35 E - Cola Whips: £ 0. 22 X - Exit While money > 0 sweet = Input “Which sweet do you want to buy? ” if sweet == “X” Break / Exit while loop quantity = input “How many sweet do you want to purchase? ” if sweet == “A” else if cost = 0. 20 * quantity if money > cost money = money - cost Display “Money left: ” + money End sweet == “B” else if …. “C” …. “D” …. “E” cost = 0. 30 * quantity else Display “You do not have enough money”

Limit 33 • “Limit 33” is a simple game of adding a series of

Limit 33 • “Limit 33” is a simple game of adding a series of random numbers to a running total. The player’s aim it to reach a total as close as possible to 33 without taking this total over 33. • Rules of the game: – A player starts with a total of zero. – On each turn a random number, between 1 and 10 is generated and added to the player’s total. – If the player’s total exceeds 33, the player has lost and the games end: Game Over. – At the end of each turn the player is asked whether they want to complete another turn or quit. – If they quit, the player is given a score as follows: • Zero points if their total is below 24 or above 33. • 10 x (total – 23) points if their total is between 24 to 33. For instance with a total of 29, the player would score 10 x (29 -23) = 60 Points. The maximum score they can reach is 10 x (33 -23) = 100 when they reach a total of 33!