添加纯虚函数

时间:2016-08-09 02:55:16

标签: c++ function

我正在研究我的最后一个学校项目。这是我的老师要我对我写的代码做的事情,但我真的不明白。有人可以帮我吗?这几乎就是我的其余代码 - 我不想因为它太长而把整个事情都搞砸了。

“你没有任何类,只有函数调用。如果你创建一个抽象的Scene类,使RunScene()函数变为纯虚拟。然后你可以为Intro,Scene1,Scene2创建Scene的子类, Scene3并将场景代码放在适当的RunScene()函数中。这对改善结构有很大帮助。“

void nichole() {
    int choice4;
    do {
    cout << "\t ----------------------------" << endl;
    cout << "\t ----------------------------" << endl;
    cout << "\t\n i really like nichole the best" << endl;
    cout << "\t\n Nichole it is What is her interst?" << endl;
    cout << "\t\n idk" << endl;
    cout << "\t\n What do you mean you dont know?" << endl;
    cout << "\t\n ive never really talked to her" << endl;
    cout << "\t\n Well then how is she your favorite?" << endl;
    cout << "\t\n because shes the prettiest lol" << endl;
    cout << "\t\n Of course she is bry. can you tell me anything about her?" << endl;
    cout << "\t\n shes a cheerleader" << endl;
    cout << "\t\n Perfect I can work with that" << endl;
    cout << "\t\n thank you :)" << endl;
    cout << "\t\n tomrow you have to ask her out on a date" << endl;
    cout << "\t\n what no way man shes way to hott" << endl;
    cout << "\t\n Then get beat up by your cousins giant boy friend then" << endl;
    cout << "\t\n ahh fine what do i say to her exactly ive never asked" << endl;
    cout << "\t out on a date before" << endl;
    cout << "\t\n Choose response:" << endl;
    cout << "\t 1.Ask her to the theater" << endl;
    cout << "\t\ 2.Ask her for a cup of coffee" << endl;
    cout << "\t\ 3.Ask her to a football game" << endl;
    cin >> choice4;

        if ((choice4== 1) && (choice4 = 2)) {
            cout << "\t\n are you sure" << endl;
            cout << "\t\n Yes im sure" << endl;
            cout << "\t\n ok if you say so" << endl;
            loose();
        }
        else if (choice4 = 3) {
            cout << "\t\n dude your a genius" << endl;
            cout << "\t\n I Know get back to me tomorow and let me know how it goes" << endl;
            loose();
        }
        else {
            cout << "Invalid choice" << endl;
        }
    }
    while ((choice4 != 1) && (choice4 != 2) && (choice4 != 3));
    system("pause");
}

0 个答案:

没有答案