CS110 Introduction to Computer Science

Fall 1998

Programming Project #5

Due in class on Thursday, December 3, 1998.


Perform a complete top-down design for the following problem. Code the final algorithm in C++. Compile, debug (if necessary!) and execute your program. See below for what to hand in.

TITLE: Top of the Pop Charts.

Your program would maintain a top-10 list of songs or records. It should use an input file that lists the previous week's top 10 songs and their artists. After the file has been read, the user is presented with each title and is requested to enter a number between 0 and 10 to indicate the song's current position (a 0 indicates that it is no longer on the charts). After that, the user is asked for the remaining slots (songs that have appeared since). The updated top 10 list is then displayed and stored in a new file. The display of the list would also show the title's position in the previous week's list.

INPUT

Each line of the input file contains one song, as below:

1 4 I'm Diggin' you (Me Shell)

where the first number is the title's position in the current week. The second number is its position it the previous week. The name of the artist is enclosed in parenthesis.

Your program should ask the user for the name of the input file.

OUTPUT

The output of the program will be as described above. The program should prompt
the user for the name of the output file.

ERRORS

Any input which does not meet the specifications above is detected
and the user is reprompted for input after appropriate messages (shown above)
are displayed.

EXTRA CREDIT

You can try and build a graphical user interface for this program for extra credit. Note: Do this ONLY if you feel VERY confident and if you have PLENTY OF TIME TO SPARE!!


WHAT TO HAND IN

Hand in the following in the order given:

  1. Your top down design for this program.
  2. A User's Manual that would explain how to use your program.
  3. A series of runs of your program demonstrating its correctness.