// File:   02constFunction.cpp for CS319-Week 12
// What:   An example of a const function in a class.
//         This code is adapted from Week11/02StaticVarInClass.cpp

#include <iostream>
#include <string>

class Student
{
private:
  std::string name;
  static std::string university;
public:
  Student(std::string n) {name=n;};
  void set_name(std::string n) {name=n;};
  void set_university(std::string u) {university=u;};
  std::string get_name(void) const {return(name);};
  std::string get_university(void) const {return(university);};
};

// the static member must be initialised in global space
std::string Student::university="QCG";

int main(void)
{
  Student A("Alice Perry");
  const Student B("Agnes Perry");

  std::cout << "Object A: \t" << A.get_name() <<
    " is a student at " << A.get_university() <<  std::endl;

  std::cout << "Object B: \t" << B.get_name() <<
    " is a student at " << B.get_university() <<  std::endl;

  return(0);
}
  


  
  
  
