• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 11. Arrays > The Multiple-Choice Quiz, Take 3

11.12. The Multiple-Choice Quiz, Take 3

In Example 9-13, we revised the multiple-choice quiz from Chapter 1 (Examples Example 1-1 through Example 1-4). At that time, we improved the quiz code by creating reusable, centralized functions. Now that we've studied arrays, we can return to the quiz to make a few more improvements. This time, we'll use arrays to store both the user's answers and the correct answers for each question, making our code more succinct, legible, and easier to extend if we want to add new questions.

The changes we need to make to the quiz take place on the scripts layer of frame 1, where our main quiz code is located. Both the previous version and this updated version of the quiz can be found in the online Code Depot. To see what improvements we'll make this time around, read through the code in Example 11-7, paying special attention to the comments.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint