C++ do while循环c+;上的预期表达式出错+;
我还没有完成我的代码,但到目前为止,我有一个错误,一直在底部,我试图在第一行执行do while语句C++ do while循环c+;上的预期表达式出错+;,c++,C++,我还没有完成我的代码,但到目前为止,我有一个错误,一直在底部,我试图在第一行执行do while语句 in中的“Complete”是否做得很好,但其他两个当前可以使用work。我也无法重现您的错误。我试着在cpp.sh中运行它,它似乎运行得很好(尽管我不知道您打算实现什么)。 #include <iostream> using namespace std; int main() { int numTickets, options, count = 0; double
in中的“Complete”是否做得很好,但其他两个当前可以使用work。我也无法重现您的错误。我试着在cpp.sh中运行它,它似乎运行得很好(尽管我不知道您打算实现什么)。
#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;
}