CS110 Introduction to Computer Science

Spring 2000

Programming Project #6

Due in class on Thursday, April 27, 2000.

THE DEADLINE OF APRIL 27 IS FIRM! NO CREDIT WILL BE AWARDED FOR ANY WORK HANDED IN AFTER 2:40 P.M., APRIL 27.

Vote on Orbit for your favorite Artist/CD for a Bryn Mawr Top Ten list.


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. All three pieces of information will be on the same line in the input file (as shown above).

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.


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.

Vote on Orbit for your favorite Artist/CD for a Bryn Mawr Top Ten list.

EXTRA CREDIT

Finish and submit the project by 2:40 p.m. on Apr 25 (Tuesday) for extra credit.

NOTES

  1. Start Early!
    Divide the problem into smaller more manageable parts, make a schdule of implementation. Here is one for example:
  2. Implementation Schedule:
    By April 18: Write a program that is able to read the previous week's list from a file and prints it out.
    By April 20: Enhance the program so it updates the previous week's list to the current one. And ensure that the list is stored in proper order. At this stage, your program inputs a list from a file, asks the user to update it, and then prints out on the screen, the new list of top ten songs.
    By April 25: Add the file output facility to your program. That completes the project. You will also have time to put any finishing touches before handing it in.
  3. Judiciously incoorporate C++ facilities for modular programming (use of functions with parameters!) to make your program easier to read and modify. For example, have seperate functions for each of the major steps: ReadTopTenList(...), PrintTopTenList(...), UpdateList(...), StoreInFile(...), etc.


Back to CS110 Page