Skip to content

Instantly share code, notes, and snippets.

@splitline
Created October 13, 2016 12:43
Show Gist options
  • Save splitline/682abc4f9112be8c795e603a8b5ebd2f to your computer and use it in GitHub Desktop.
Save splitline/682abc4f9112be8c795e603a8b5ebd2f to your computer and use it in GitHub Desktop.
//Fig.3.1:fig03_01.cpp
//Define class GradeBook with a member function displayMessage,
//cteate a Gradebook object, and call its display Message function.
#include<iostream>
using namespace std;
//GradeBook class definition
class Gradebook
{
public:
//function that displays a welcome message to the GradeBook user
void displayMessage() const
{
cout << "Welcome to the Grade Book!" << endl;
}; // end function displayMessage
}; // end class GradeBook
//function main begins program execution
int main()
{
Gradebook myGradeBook; // create a Gradebook object named myGradeBook
myGradeBook.displayMessage(); // call object's displayMessage function
} // end main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment