|
| |
Relating Lists - Sample
Lab Exercises
-
Create
a program that reads a list of names from a sequential file into an array,
storing the name, and another array corresponding to their age. The arrays
must be organized so that there is a 1-to-1 correspondence between the
indices of the name and age. When the user enters an age, the names of all
the people of that age should be displayed. The user should also be able to
add, delete, and modify the names and ages entered.
-
Create
a program that creates and administers a true/false quiz. Questions are read
from a data file into one array and a related array is used to store the
answers, either T or F, for each question. When the user takes the test,
questions are presented in random order, without repetition. Keep track of
the number of questions answered and the number of correct answers. When the
user has finished the quiz, display the mark as a percentage.
Source:
Public
and
Catholic
District School Board Writing
Partnership,
Course
Profile: Computer
and Information Science,
Grade 11, University/College
Preparation ICS3U,
Queen’s Printer for Ontario, 2001, adapted.
|