1. The CD name
This field will consist of string of characters (max 80).
2. Artist
This field will consist of string of characters (max 80). You can assume
that each CD will only have one artist associated with it.
3. The genre
This field will consist of string of characters (max 80). You ignore
cases where a CD falls under multiple categories.
4. Price
The program stores the price of the CD as an integer value in cents (e.g., $19.99 = 1999
cents).
Features to be
implemented |
|
- Correctly declares a new type 'CD' that tracks all the pertinent
information for a CD.
|
|
- Correctly declares a new type 'CDList' that is an array of type
'CD' with 100 elements.
|
|
- Declares an instance of the array, type 'CDList'.
|
|
- Displays instructions on how to use the program each time that
it is run.
|
|
- Display a signoff message to indicate to the user that he or she
has quit the program.
|
|
- Some form of debug mode has been implemented.
|
|
- Displays a menu showing the list management functions.
|
|
- Program repeats until the user quits the program. Each time that
program repeats the main menu (above) is displayed. The (Q)uit
option of the main menu has been implemented.
|
|
- (D)isplay: Displays the list in a neat and
presentable form (try running the sample executable for an example).
Only the occupied array elements will be displayed. If the array is
empty then some sort of status message should be provided (e.g.,
"List is empty: nothing to display"). Each CD should be separated by a line of stars. When the list is
long, to prevent the output from scrolling off the screen your
program should 'pause' the display every often (say after displaying
a half a dozen list elements) while it waits for a response from the
user to tell it to continue (e.g., "Hit enter to continue"). In
order to receive credit for this feature you must have already
implemented some way of adding elements to the list either by
reading from file or by allowing the user to type in the information
for a new element.
|
|
- Each time that CD's are shown (display, find, present) the price
shown in dollars instead of cents. (JT's hint: after you convert
from dollars to cents you need to convert the real dollar value to a
integer value in cents so consider using something like the
round function).
|
|
- (L)oad: The user will be prompted for the name of the
input file and the program loads the information for the list from
that file. The file that you can use for simple testing is 'mini.txt'.
Before handing in your assignment you should make sure that it also
works with the full sized input file 'cd.txt'.
What was in the collection previous to the load is lost. Your
program should check that the array capacity hasn't been exceeding
during the loading process.
|
|
- Program can detect and properly handle the case of an empty file
(e.g., 'empty.txt') by displaying
some sort of status message (e.g., "File is empty: nothing to
read").
|
|
- (S)ave: The user can save the list to a file (name
specified at run time). In order to receive credit for this feature
your program must be to read and write to the input file multiple
times (that means that you must write the information in a format
that is identical to how the information was originally stored).
|
|
- (F)ind: Program can find details about a particular CD.
The user enters the CD name and if a
match was found all the information for that CD will be displayed
onscreen. Otherwise a suitable error message should be displayed. The
program should not allow the user to search an empty list (a suitable
error message should be displayed).
|
|
- (P)resent: You can get credit for either the basic or the
enhanced version (but not both). However in both cases the price for
min and max should be entered in dollars by the user so your program
needs to somehow convert it to cents (JT's hint: after you
convert from dollars to cents you need to convert the real dollar
value to a integer value in cents so consider using something like
the
round function). As with the find feature, the user should
not be able to invoke this feature if the list is currently empty (a
suitable error message should be displayed).
|
|
|
- Basic version: Program will present all the CD's within a given
min and max price range.
|
|
|
- Enhanced version: The user can enter a negative value for either
the min or the max to ignore either criteria: 1) If the user enters a
negative value when prompted for the min value then the min value
becomes zero (effectively having no minimum price) 2) If the user
enters a negative value when prompted for the max value then the max
value becomes an arbitrary value that is higher than the price of any
of the CD's e.g., 65000 effectively removing the upper bound on the
search.
|
|
- (A)dd: New CDs can be added to the list if the list is
not yet full (a suitable error message should be displayed if it
is). When this option is selected the user will be prompted to enter
the information for the CD to be added to the end of the list.
|
|
- (R)emove: Allows CD's to be removed from the list. You
can implement one of two versions of this features (shown below). In
both cases the program should produce some sort of error message if
the list is already empty when this feature is invoked.
|
|
|
- When this feature is invoked the program will remove the last CD
from the list.
|
|
|
- When this feature is invoked the user will be
prompted to end the name of the CD to remove. If the match was found then the
CD
is removed otherwise some sort of error message should be displayed
(e.g., "CD: Let go' could not be found in the list").
|
|
- (O)rder: Sorts the CD's into alphabetical order according
to the CD name.
|