Created
January 24, 2019 07:10
-
-
Save OrsoEric/4eea645b184fca995586c4b7f5c91a31 to your computer and use it in GitHub Desktop.
Derived Class Header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**************************************************************************** | |
** Derived Class | |
** Student | |
***************************************************************************** | |
** PARAMETER: | |
** RETURN: | |
** DESCRIPTION: | |
** Class Student inherit from class Human | |
** A student is a special type of human | |
****************************************************************************/ | |
class Student: public Human | |
{ | |
//Visible to all | |
public: | |
///-------------------------------------------------------------------------- | |
/// CONSTRUCTORS | |
///-------------------------------------------------------------------------- | |
//Empty constructor | |
Student( void ); | |
//Initialized constructor | |
Student( bool f_male, int age, std::string name, int id ); | |
///-------------------------------------------------------------------------- | |
/// DESTRUCTORS | |
///-------------------------------------------------------------------------- | |
//Default destructor | |
~Student( void ); | |
///-------------------------------------------------------------------------- | |
/// SETTERS | |
///-------------------------------------------------------------------------- | |
//Set student id | |
bool set_id( int id ); | |
///-------------------------------------------------------------------------- | |
/// GETTERS | |
///-------------------------------------------------------------------------- | |
//Get student id | |
int get_id( void ); | |
///-------------------------------------------------------------------------- | |
/// TESTERS | |
///-------------------------------------------------------------------------- | |
///-------------------------------------------------------------------------- | |
/// PUBLIC METHODS | |
///-------------------------------------------------------------------------- | |
//Base class has a method show of the same name. This wins out hiding Human::show() | |
bool show( void ); | |
///-------------------------------------------------------------------------- | |
/// PUBLIC VARS | |
///-------------------------------------------------------------------------- | |
//Visible to derived classes | |
protected: | |
///-------------------------------------------------------------------------- | |
/// PROTECTED METHODS | |
///-------------------------------------------------------------------------- | |
///-------------------------------------------------------------------------- | |
/// PROTECTED VARS | |
///-------------------------------------------------------------------------- | |
//Visible only inside the class | |
private: | |
///-------------------------------------------------------------------------- | |
/// PRIVATE METHODS | |
///-------------------------------------------------------------------------- | |
//Here so that i can easly copy the code. | |
bool dummy( void ); | |
///-------------------------------------------------------------------------- | |
/// PRIVATE VARS | |
///-------------------------------------------------------------------------- | |
//student id number | |
int g_id; | |
}; //End Class: Student |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment