fig3.3

来源:互联网 发布:js九九乘法表怎么写 编辑:程序博客网 时间:2024/05/21 19:32
#include<iostream>#include<string>using namespace std;class GradeBook{public:void displayMessage(string courseName) const{cout << "Welcome to the book for\n" << courseName << "!"<< endl;}};int main(){string nameOfcourse;GradeBook myGradeBook;cout << "Please enter the course name:" << endl;getline(cin, nameOfcourse);cout << endl;myGradeBook.displayMessage(nameOfcourse);system("pause");return 0;}

0 0
原创粉丝点击