CSCI 131 Techniques of Programming--Spring 2014

    Home | | Schedule | | Assignments | | Lectures | | Resources

    Solution to Lab 8

    Structs and Classes

    Question 1 Why should the Student parameter of the ReadData() function be a reference parameter and the parameter of PrintStudent () a value parameter?

      Because ReadData changes the parameter

    Question 2 List the private data members of the Employee class.

      char name[30], float hourlyPay, int idNum

    Question 3 Which public member function does not change any of the private data members? How do you know this?

      The Print( ) and GetID( ) functions, because they have const at the end of their function headers.

    Source code for student.cc.

    Source code for gpa.cc.

    Source code for employee.h.

    Source code for employee.cc.

    Source code for computePay.cc.

    Source code for payroll.cc.


    Home | | Schedule | | Assignments | | Lectures | | Resources



    CSCI 131: Techniques of Programming
    Last Modified: April 6, 2014
    Page Expires: October 12, 2014