Lecture notes for the Introduction to Computer Science II by James Tam | Return to the course web page |
1. Site name
The name of the site will be stored as a string of ASCII characters.
2. Vacation type
This field describes the main reason for traveling to the site. There can be four different categories of sites each one being represented by a single character code: relaxation (r), excitement (e), culture (c) or food (f). Your program must be able to check that the user only enters one of these characters for the vacation type and if not it will prompt him or her to enter a valid value. For this assignment you can assume a particular site will not be categorized in multiple ways. When the user is prompted to enter the information for a new site he or she will be prompted to only enter a single character. However when the information for a site is displayed it will show a full description for the vacation type. (For example, instead of displaying 'r' the program should display something more descriptive like 'relaxation').
3. Rating
This field is a numerical value from 1 - 5 that indicates how much the person wants to go to a particular vacation spot (5 being the most desirable and 1 being the least desirable). Similar to the vacation type your program must be able to check that the user enters a valid value and will prompt him or her to enter in a proper value when this doesn't occur.
For the last three features, if the list is empty then an appropriate status message should be displayed to the user (e.g., "Unable to remove site: List is empty") and it should only invoke the appropriate feature if the list is not empty. In the cases where the user enters the name of the site, the search should be performed by performing case insensitive comparisons (e.g., 'Calgary' and 'CALGARY' should show as a match).