循环c ++中的错误预期表达式

时间:2016-02-15 05:41:22

标签: c++

我还没有完成我的代码,但到目前为止,我有一个错误,一直在底部,我正在尝试做我做的同时声明第一行 cout << "Please enter one of the following: \n";说预期的表达式,所以它不允许我运行代码,请帮忙吗?

#include <iostream>
using namespace std;

int main() {
    int numTickets, options, count = 0;
    double total, discount, costTicket = 10, discountPrice = .05;
    char member;

    cout << ":)\t Welcome to the Regal Entertainment Group Theater\t :)\n"
         << ":)\t ****The greatest movie theater in the world.****\t :)\n\n";

    cout << "Please enter one of the following: \n";
    cout << "1 - I want tickets to watch the movie!\n"
         << "2 - I'm out.\n";

    cin >> options;

    cout << "How many tickets will you need to watch your movie tonight? ";
    cin >> numTickets;

    cout << "Are you a member of our marvelous Regal Crown Club (Y/N)? ";
    cin >> member;

    if(numTickets <= 0)
        cout << "Please enter a number greater than 0.";
    else if(numTickets < 4)
        costTicket = 10;
    else if(numTickets >= 5)
        costTicket = 8;

    if(member == 'Y' || member == 'y')
    {
        discount = costTicket * numTickets * discountPrice;

        total = numTickets * costTicket - discount;

        cout << "Your total for the movie tickets is going to be: ";
        cout << "$" << total << endl;
        cout << "You saved $" << discount << endl;

        cout << "You can pick up your free small popcorn at the stand.\n";
        cout << "Thanks for coming to watch your movie at Regal Entertainment Group!\n";
    }
    else
    {
        total = numTickets * costTicket;

        cout << "Your total for the movie tickets is going to be: ";
        cout << "$" << total << endl;
        cout << "Thanks for coming to watch your movie at Regal Entertainment Group!\n";
    }

    system("cls");

    do
    {
        cout << "Please enter one of the following: \n";
        cout << "1 - I want tickets to watch the movie!\n";
        cout << "2 - I'm out.\n";

        cin >> options;
    }while(options != 2);

    return 0;
}

0 个答案:

没有答案