IUP Computer Science
COSC 110    Spring 2007

Project #5
(NSM Senior Stats)
(Due  13 April 07)

A file named NSMseniors.txt contains some basic information about students in the College of Natural Science and Mathematics who are planning to graduate in December 2007.  This file can be found on the I: drive at  I:\jlwolfe\110\NSMseniors.txt    The information consists of one line for each student in the following form:

Lastname, Firstname          Major  No-IUP-credits  No-transfer-credits  Quality-points

The student information is held in the file in alphabetical order, based on the student's names.  Here are the first few lines of the file:

Alligator, Albert          GEOS   92   0  223
Arbuckle, Jon              COSC  100   0  268
Bailey, Beetle             COSC   99   7  250
Blossom, Auntie            BIOL  117   0  328

Unfortunately, it has been discovered that three students have been omitted from the file and need to be added.  In addition, several pieces of statistical information based on the content of the file are needed.  You are to write a  program that performs all of the following actions:

  1. Read in the data from the file.  You will need multiple arrays to hold it.
  2. Prompt for the student information to be added to the file's data.  You will need to prompt for a name, major, IUP credit count, transfer credit count, and quality point count three times.  The three students to be added have the following attributes:

  3.  

     

    Name                 Major   IUP Credits  Transfer  Quality Pts
    Smith, Mabel          COSC       104         16            258
    Adams, Douglas        PSYC       101          0            287
    Halftrack, Martha     CHEM        97          0            264

    These students need to be added into the list of students in the proper locations, so that the list remains in alphabetical order.
     

  4. Display the number of students in each major.  There are nine different majors.   Their codes are:  BIOC, BIOL, CHEM, COSC, GEOS, MAED, MATH, PHYS, and PSYC.
  5. Display the names of all students who already have 120 or more credits.  Also, show the number of total credits each such student has.
  6. Write a replacement file for NSMseniors.txt which contains all of the seniors, including the three added ones and all of their information.  This file must be named yourname-update.txt  where yourname is replaced with your actual name.  This new file must have the same format as NSMseniors.txt does.
ALL five of these tasks must be done using functions.  My suggestions for the function names are:  1. GetData, 2. AddData, 3. MajorCounts, 4. OneTwentyOrMore, and 5. Update.

Hand in a printout of your well documented program and a printout showing the displays specified above.  Also, copy both the .cpp file for this program and the update file to the handin folder on the P: drive.  Be sure the .cpp file is named after you.  If your program does any of the following extra credit tasks, the printout showing results must show the associated extra credit display too.

Extra Credit Possibilities:

Display the name and GPA of the student in each major that has the highest GPA for students in that major.  This display should show the major, student name and GPA.

Display the average number of transfer credits a student has, consider all students.

Display the overall grade point average for all of the seniors.  This is the sum of their quality points divided by the sum of their IUP credits.

You need to get the overall GPA in order to try this next one.  Determine the uniformity of the senior class by selecting every fifth senior and calculating the GPA and average number of credits for this subset.  Display the subset GPA, overall GPA, and average number of credits for the subset.

If you do any of the extra credit tasks, each of them must also be done using a function.