Created
October 27, 2016 11:45
-
-
Save gabrielcesar/aef1c2370190a06cde649cb83bd315e9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// 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