Page 251 -
P. 251
a host of requests
Head First TVN now
produces game shows
It’s more than just sports at Head First TVN, as the station has
entered the lucrative world of live game show broadcasting.
Their flagship show, Who Wants to Win a Swivel Chair, is attracting
viewing figures in the millions... not bad for a station that operates
on a shoestring budget.
You’ve been approached by their stressed-out (but incredibly
smooth) game show host to help with a program he needs. TVN
was so impressed with your work last time that they are offering
two free, front-row tickets to the Grand Final as payment for your
work.
I can‛t keep track
of the score and ask the
questions and sound the
buzzer... all by myself...
can you help?
TVN’s game
show host.
You’ve had a few conversations with the host and determined a
list of program requirements:
1. The host wants to be prompted after a question has been asked
to press either 1 for a correct answer or 2 for a wrong answer.
2. Based on the key pressed, an appropriate sound effect needs to
play.
3. The program needs to remember how many answers were
correct and how many were wrong.
4. The host will end the quiz by pressing 0. Then the program
will display the number of right, wrong, and asked questions.
Let’s flesh out what’s required in pseudo-code.
216 Chapter 7