



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Name: Class:
Michael is writing a program for a dice game played with three dice. (a) The player rolls the dice, and is given points according to the following algorithm. State the value of the scores if the dice rolled are: 246 551 444 (b) Some rolls of the dice produce a negative score. State a set of three numbers that can be used to test whether the algorithm produces a negative score when it should, and state the expected output of your test data.
An amusement park operates a smartcard system for visitors. When they enter the park, a visitor chooses the amount they wish to put on their card. Rides cost differing amounts, and to get through a barrier for a particular ride, the visitor inserts their card. The balance on the card is checked. If there is enough money on the card, the balance is updated and displayed and the barrier opens. If there is not enough money left on the card, the current balance is displayed with a message “Not enough for this ride – need to top up”. Complete the flowchart for the barriers in the amusement park.