Student Listing

program filename for this assignment:  students.cpp

 

Overview:

 

Create a student class.  This class has several fields (also known as data members). These fields are first and last name of the student, birthday (month, day and year – all integers), and GPA. This program design should have at lest the following functions:  setFieldValues, getLastName, getFirstName, printFieldValues. You may add others if you need them.

This program will create a list (array) of students from information stored in a file.  The maximum number of students is 100. The program will then list the students in the order read.  Then the program will sort the list by student name and display the sorted list.  Finally, the program will allow the user to retrieve information about a particular student.

 

Input:

 

The information about students is stored in a file students.in in the following format.

 

Melissa Williams 10 9 1976 3.7

Crystal Williams 8 19 1977 2.8

Tanasia Williams 7 14 1978 3.1

Randi Robbins  9 21 1975 2.2

 

 

Output:

 

All output is displayed on the screen.  First the program displays the data in sorted order using the following format.  Then the program asks if the user would like complete information on any specific person. If so, the user must give the first and last names.

 

The original list is:

Williams, Melissa

Williams, Crystal

Williams, Tanasia

Robbins, Randi

 

The sorted list is:

Robbins, Randi

Williams, Crystal

Williams, Melissa

Williams, Tanasia

 

Would you like information about a specific student (y or n)? y

Give that student's first and last name.  Randi Robbins

 

Randi Robbins was born 9/21/1975. Her GPA is 2.2

 

Would you like information about a specific student (y or n)? y

Give that student's first and last name.  Randi Williams

 

There is no Randi Williams in the list.

 

Would you like information about a specific student (y or n)? n

 

 

 

Turnin and Grading Policy:

 

When you have completed the assignment, be sure you are in the directory where you source code files (.cpp or .cc files) are present:

%turnin cis121a prog4 students.cpp