Please send questions to st10@humboldt.edu .
#include <iostream>
#include "Student1.h"
#include "uglyFunct.h"
using namespace std;

//--------------------------------------------------------
// showDiff1.cpp
//
// Contract: main: void -> int
// Purpose: show that, without overloaded assignment
//          operator, assigning one object to another
//          really DOES make it reference the SAME
//          members when pointers are involved...
//          (AND copy-situations have the same effect)
//          [NOTE that this #include's Student1.h!]
//
// Examples: not really applicable --- simply shows
//           that, when [Student1.h's] Student s2 is 
//           assigned Student s1, changing one of s2's 
//           grades ALSO changes s1's corresponding grade, 
//           too!
//
// by: Sharon M. Tuttle
// last modified: 12-3-03
//--------------------------------------------------------

int main()
{
    Student st1("A", "a", 4);
    st1.set_grade(0, 100);
    st1.set_grade(1, 95);
    st1.set_grade(2, 888);
    st1.set_grade(3, 99);

    Student st2;

    // using default assignment operator...
    st2 = st1;

    st2.set_grade(2, 50);

    cout << endl;
    cout << "only changed st2's grade 2 to 50 --- " << endl;
    cout << "   what is st1's grade 2? " << endl;
    cout << "-------------------------------------" << endl;
    cout << "st1: grade 0: " << st1.get_grade(0) << endl;
    cout << "     grade 1: " << st1.get_grade(1) << endl;
    cout << "-->  grade 2: " << st1.get_grade(2) << " <---"
         << endl;
    cout << "     grade 3: " << st1.get_grade(3) << endl;
    cout << endl;
    cout << "st2: grade 0: " << st2.get_grade(0) << endl;
    cout << "     grade 1: " << st2.get_grade(1) << endl;
    cout << "-->  grade 2: " << st2.get_grade(2) << " <---"
         << endl;
    cout << "     grade 3: " << st2.get_grade(3) << endl;

    // NEXT: does this show effect of copy constructor?
    cout << endl;
    cout << "COPY CONSTRUCTOR effects demo?" << endl;
    cout << "------------------------------" << endl;
    uglyFunct(st2);
    cout << endl;
    cout << "after call to uglyFunct(st2): " << endl;
    cout << "st2's last name: " << st2.get_lastName() 
         << endl;
    cout << "st2: grade 0: " << st2.get_grade(0) << endl;
    cout << "     grade 1: " << st2.get_grade(1) << endl;
    cout << "     grade 2: " << st2.get_grade(2) << endl;
    cout << "-->  grade 3: " << st2.get_grade(3) << " <---"
         << endl;

    return 0;
}