Chapter 2: Preparing for the project work
31
2.6 Test your knowledge and understanding
1. Sketch a class diagram for the following situations:
a. A library database to include novels, their authors, the various
editions available and the publishers.
How would you handle
multiple copies of the same edition of the same book, such as you
might find in a college library?
b. A database of music considering songs, albums, singers, producers,
writers.
Keep your class
diagrams as simple as you can, but note all
complexities or confusions that you might need to deal with later.
2. What spreadsheet chart would you use for the following situations:
a. Monthly rainfall data over three years.
b. Numbers in a country’s population within age groups and by gender.
c. Gold price in US$ over three years.
3. Sketch a paper model of a spreadsheet for the following situations:
a. Calculating Body Mass Index (BMI). Weight data may come in
pounds, grams or stones and pounds. Height data in inches,
centimetres or feet and inches. (You can find the BMI formula
online if need be.)
b. The cost per student of a class trip to the theatre.
This is to include
tickets, hire of a bus, insurance and meals. The cost will depend on
the number of students who choose to go; for example,
bus hire is
fixed for n= 1 to 50 while every 10th ticket is free from the theatre.
4. For each of the classes shown in the class diagrams sketched in
Question 1 above add some essential attributes that you would want to
store data about. Are you sure that you have always placed the data in
the right class? Are there situations where it may be debatable?
Chapter 3: Core concepts: information, data
and systems
33
Dostları ilə paylaş: