Skip to content

Instantly share code, notes, and snippets.

@gabrielcesar
Created October 27, 2016 11:45
Show Gist options
  • Save gabrielcesar/aef1c2370190a06cde649cb83bd315e9 to your computer and use it in GitHub Desktop.
Save gabrielcesar/aef1c2370190a06cde649cb83bd315e9 to your computer and use it in GitHub Desktop.
// 20161025
// Gabriel Cesar - [email protected]
// ufopa
#include <iostream>
#include <string>
using namespace std;
class GradeBook
{
public:
void setCourseName ( string name )
{
courseName = name;
}
string getCourseName ()
{
return courseName;
}
void displayMessage ()
{
cout << "Welcome to the grade book for\n" << getCourseName () << "!" << endl;
}
private:
string courseName;
};
int main ()
{
string nameOfCourse;
GradeBook myGradeBook;
cout << "Please enter the course name: " << endl;
getline ( cin, nameOfCourse );
myGradeBook.setCourseName ( nameOfCourse );
cout << endl;
myGradeBook.displayMessage ();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment