I have written this program and it compiles with no obvious errors in borland.

However when executed it has problems. Here is what i see

case 2
is not saving the imput scores correctly

case 3
shuts the whole program into fubar land

i am including the code and the console window so maybe someone can explain what is happening and i can fix it.

thanks

console window shows
1. Add a new student to roster.

2. Enter exam score for all students.

3. Display student exam averages.

4. Display course information for all students.

5. Exit program:

1

Please enter students first and last name.
Jessie Brown
Enter student ID.
262750619
Brown, Jessie
ID: 262750619


1. Add a new student to roster.

2. Enter exam score for all students.

3. Display student exam averages.

4. Display course information for all students.

5. Exit program:

1

Please enter students first and last name.
Bill Brown
Enter student ID.
259419917
Brown, Bill
ID: 259419917


1. Add a new student to roster.

2. Enter exam score for all students.

3. Display student exam averages.

4. Display course information for all students.

5. Exit program:

2

Enter Exam number and score.
0
95
Enter Exam number and score.
0
65

1. Add a new student to roster.

2. Enter exam score for all students.

3. Display student exam averages.

4. Display course information for all students.

5. Exit program:

4

Brown, Jessie
ID: 262750619
95
-1
-1
Avg = 95
Brown, Bill
ID: 259419917
95
-1
-1
Avg = 65

1. Add a new student to roster.

2. Enter exam score for all students.

3. Display student exam averages.

4. Display course information for all students.

5. Exit program:

2

Enter Exam number and score.
1
85
Enter Exam number and score.
1 75

1. Add a new student to roster.

2. Enter exam score for all students.

3. Display student exam averages.

4. Display course information for all students.

5. Exit program:

4

Brown, Jessie
ID: 262750619
95
75
-1
Avg = 90
Brown, Bill
ID: 259419917
95
75
-1
Avg = 70

1. Add a new student to roster.

2. Enter exam score for all students.

3. Display student exam averages.

4. Display course information for all students.

5. Exit program:

2

Enter Exam number and score.
2
85
Enter Exam number and score.
2 85

1. Add a new student to roster.

2. Enter exam score for all students.

3. Display student exam averages.

4. Display course information for all students.

5. Exit program:

4

Brown, Jessie
ID: 262750619
95
75
-1
Avg = 88.3333
Brown, Bill
ID: 259419917
95
75
-1
Avg = 75

1. Add a new student to roster.

2. Enter exam score for all students.

3. Display student exam averages.

4. Display course information for all students.

5. Exit program:
code that main is in
Code:
/*
  Jessie Brown
  cop2334






  */

#include "Student.h"
//Prototypes -- function declarations.
  //-----------------------------------

   void Menu_Selection();
   void enter_students (int,int& total);
   Student student[STUDENT_LIMIT];
   int find_student(int,int,int& total);



int main()
{


  Menu_Selection();







    // the following lines keep the console open
        cout << "\nPress <ENTER> to continue.\n";
        fflush(stdin);
        cin.get();


	return 0;
}


/*------------------------------------------------------------------------------
        This section of code is the initial screen after employee signs in
                to system.  From here said employee can choose what she must
                do with each customer being assisted.
------------------------------------------------------------------------------*/


  void Menu_Selection()
{



     int total=0;
     int studentID;
     int option;
     int examNumber;
     double score;
     do
     {
          cout << endl
               << "1. Add a new student to roster. \n \n"
               << "2. Enter exam score for all students. \n \n"
               << "3. Display student exam averages. \n \n"
               << "4. Display course information for all students. \n \n"
               << "5. Exit program: \n \n";

          cin >> option;
          cout << endl;

          switch (option)
           {
                case 1:
                     enter_students (STUDENT_LIMIT,total);
                     cout << endl;
                     break;

                 case 2:
                      /* this allows you to enter an exam number and score for
                      each stutdent in this class.  assumes that you know the
                      number, that you have put the papers in some sort of order
                      that matches the order of students....if you skip a number
                      or the score does not track your average will be off as
                      a -1 will be put in that exam number spot.*/

                      for( int i = 0; i < total ; i++ )
                        {
                         cout << "Enter Exam number and score.\n";
                         cin >> examNumber;
                         cin >> score;
                         student[i].setExamScore(examNumber, score);
                        }
                     break;

                case 3:
                     /*this will find a particular student based on his ID number
                     and will then print the average of the scored he has taken
                     and that have been recorded, it will also list the test scores
                     individually so that one can see if there is one missing,
                     a missing one would be indicated by -1*/


                     int tempID;
                     cout << "Please enter the Student ID number\n";
                     cin >> tempID;
                      for( int i=0; i<EXAM_LIMIT; i++ )
		          cout << student[tempID].getExamScore(i) << endl;
                          cout << "Avg = " << student[tempID].getExamAverage() << endl;


                     break;

                case 4:
                     for( int i = 0; i < total ; i++ )
                        {
                         cout << student[i].getFullName() << endl;
                         cout << "ID: " << student[i].getID() << endl;
                         for(int i=0; i<EXAM_LIMIT; i++ )
                           {
		             cout << student[i].getExamScore(i) << endl;
                           }
                         cout << "Avg = " << student[i].getExamAverage() << endl;

                        }
                     break;
               case 5:
                    cout << "End of Program.\n";
                    break;
                default:
                cout << "Not a valid option. Please choose a valid option. \n\n";
           }
     }while (option != 5);


}

/*------------------------------------------------------------------------------
 This function allows a user to add student, assuming that each id number is
 original (like a social security number) id number is not checked for duplicity
 If class is full it will not allow you to register another student.
------------------------------------------------------------------------------*/
void enter_students (const int STUDENT_LIMIT, int& total)
{
 string temp1;
 string temp2;

 int tempID;


 if(total >= STUDENT_LIMIT)
       {
        cout <<"Registration closed for this section.\n";
       }
      else if(total <STUDENT_LIMIT)
        {
         cout <<"Please enter students first and last name.\n";
         cin >> temp1;
         cin >> temp2;
         student[total].setName(temp1,temp2);

         cout << "Enter student ID.\n";
         cin >> tempID;
         student[total].setID(tempID);

         cout <<  student[total].getFullName() <<endl;
         cout << "ID: " <<  student[total].getID() << endl;



         total++;
         }

 }
the code for the class file (this can not be changed!)
Code:
/*
	Student.cpp
	Implementation file for Student class for Project 6
	Jim Lewis - 11.15.06
*/

#include "Student.h"

/*
	This is a constructor.
	It assigns default values to a new Student.
*/
Student::Student()
{
	ID = -1;
	lastName = "";
	firstName = "";
	for( int i=0; i<EXAM_LIMIT; i++ ) exams[i] = -1;
}

/*
	Returns full name formatted LAST, FIRST
*/
string Student::getFullName()
{
	return lastName + ", " + firstName;
}

/*
	Assigns the two parameters as first and last names.
*/
void Student::setName( string theFirstName, string theLastName )
{
	firstName = theFirstName;
	lastName = theLastName;
}

/*
	Standard getter (accessor) for ID
*/
int Student::getID()
{
	return ID;
}

/*
	Standard setter (mutator) for ID
*/
void Student::setID( int theID )
{
	ID = theID;
}

/*
	Accesses the desired score.
	If the exam number does not map to the array
		it returns a -1.
	Notice, this function does not test for a 
		negative test score.
*/
double Student::getExamScore( int examNumber )
{
	if( examNumber < 0 || examNumber > EXAM_LIMIT ) return -1;
	return exams[examNumber];
}

/*
	Sets the indicated exam to the score provided.
	This over writes any score previously entered
		without warning!!
*/
void Student::setExamScore( int examNumber, double score )
{
	if( examNumber < 0 || examNumber > EXAM_LIMIT ) return;
	exams[examNumber] = score;
}

/*
	Returns the average of all positive test scores.
	Negative scores are assumed to be invalid.
	If the total of the scores is zero, return a zero.
*/
double Student::getExamAverage()
{
	double total = 0;
	int examCount = 0;
	for( int i=0; i<EXAM_LIMIT; i++ )
		if( exams[i] >= 0 ) 
		{
			total = total + exams[i];
			examCount++;
		}
	if( examCount == 0 ) return 0;
	else return total / examCount;
}
this is the header file it is a .h file (can not be changed)
/*
Student.h
Header file for Project 6
This is the Student class interface
Jim Lewis - 11.15.06

Individual functions are documented in
the implementation file, Student.cpp
*/

#include <iostream>
#include <string>
using namespace std;

const int EXAM_LIMIT = 3;
const int STUDENT_LIMIT = 10;

class Student
{
public:
Student();
string getFullName();
void setName( string theFirstName, string theLastName );
int getID();
void setID( int theID );
double getExamScore( int examNumber );
void setExamScore( int examNumber, double score );
double getExamAverage();

private:
int ID;
string firstName, lastName;
double exams[EXAM_LIMIT];
};
any help would be greatly appreciated.
This is the first program i have had to write manipulating class files and objects. If i do not understand this I will not be able to go forward. Frankly you guys here have been the best!

Jess