Lecture 18:  Structures

Activity:  Categorizing Grid

This activity will give you the opportunity to decide on appropriate tools for a task.  For each of the following scenarios, please indicate if you should use an array or a struct.  After deciding on the appropriate data structure, please describe the contents of the data structure as it applies to each situation.
 
 
Situation Array or Struct? Contents of data structure
1.  Keeping track of rainfall data for a year    
2.  Creating a record for a person in your e-mail address book    
3.  Sorting high temperatures for the previous month    
4.  Finding the median score of your last 20 bowling scores    
5.  Keeping track of the current state of a crossword puzzle    
6.  Keeping track of a day's weather -- rainfall, high temperature, low temperature, average pressure, percent humidity    
7.  Storing a customer profile with their  account number, current balance, expiration date of charge account    
8.  Keeping track of 2 players' positions on a 2-dimensional grid