I'm doing a project in Computer Programming (a simple game using c++), for some reason the program exits after the second level. I need help, I don't know what to do T-T.
cout<<"Welcome User! Welcome to the new edition of the Harry Potter Trivia Quiz! \nThis quiz will test your knowledge and love for Harry Potter. \nThis quiz contains three levels containing five questions each; level one would be a multiple choice and level two and three will be answer by you.\n And to proceed to the next level you have to make sure you answer all correctly.\nBefore we start please enter your name:\n ";
cin>>name;
cout<<"Welcome "< cin>>submit1;
if(submit1== "yes" || submit1=="YES" )
{
cout<<"Easy Level:\n";
cout<<"1) How many players are there in Quidditch?\na.4 \nb.8 \nc.6 \nd.7\nAnswer:" ;
cin>>answer1;
cout<<"2) What is the spell that unlock doors?\na.alohomora\nb.unlocko \nc.alhomora\nd.IDK\nAnswer:";
cin>>answer2;
cout<<"3) What do you call non-magical beings in Britain?\na.no-maj\nb.muggle\nc.human\nd.non-magic\nAnswer:";
cin>>answer3;
cout<<"4) Where do wizards go when they want to deposit money?
\na.Gringgots\nb.Diagon Alley\nc.Ollivander's\nd.NONE OF THE ABOVE\nAnswer:";
cin>>answer4; cout<<"5) According to Newt Scarmander, what is the most famous school in the wizarding world? \na.Hogwarts\nb.Beubaxtons\nc.Harvard\nd.I'm too cool for school\nAnswer:";
cin>>answer5;
if( answer1=="d" || answer1=="d." && answer2=="a" || answer2=="a."&& answer3=="b."|| answer3=="b" && answer4=="a."|| answer4=="a" && answer5=="a." || answer5=="a")
{ cout<<"Congratulations "< cout<<"Do you wish to proceed?\n";
cin>>submit2;
if(submit2=="yes")
{
cout<<"Medium Level: This level is fill in the blanks.\n";
cout<<"1) Aconite is Monkshood and _____\nAnswer:" ;
cin>>ANSWER1;
cout<<"2) Mr.Dursley works for a drilling manufacturer called _____\nAnswer:";
cin>>ANSWER2;
cout<<"3) ____mph is the max speed of the Firebolt.\nAnswer:";
cin>>ANSWER3;
cout<<"4) Row __ contains the prophecy of Harry Potter and Voldemort.\nAnswer:";
cin>>ANSWER4;
cout<<"5) O.W.L stands for ________________\nAnswer:";
cin>>ANSWER5;
<b>if (ANSWER1=="wolfsbane"|| ANSWER1=="WOLFSBANE"|| ANSWER1=="Wolfsbane" && ANSWER2=="grunnings"|| ANSWER2=="Grunnings" || ANSWER2=="GRUNNINGS" && ANSWER3==150 && ANSWER4==97 && ANSWER5=="Ordinary Wizarding Level" || ANSWER5=="ORDINARY WIZARDING LEVEL" )</b><br>
{<br>
cout<<"Congratulations "<<name<<" you had answer everything correctly!\n 'Yer a Wizard, "<<name<<" .\n";<br>
cout<<"Do you wish to proceed?\n";<br>
cin>>submit3;<br>
<b> if(submit3=="yes")</b>
{<br>
cout<<"Hard Level: \n";<br>
cout<<"1) What is the spell to produce a patronus?\nAnswer:" ;<br>
cin>>Answer1;<br>
cout<<"2) Who is the leader of the centaurs?\nAnswer:";<br>
cin>>Answer2;<br>
cout<<"3) How much does a hot chocolate on the Knight Bus cost in sickles?<br>\nAnswer:";<br>
cin>>Answer3;<br>
cout<<"4) Who turned Remus Lupin into a werewolf as a child? (Full Name)\nAnswer:";<br>
cin>>Answer4;<br>
cout<<"5) The visitor’s entrance to the Ministry of Magic is an abandoned red telephone booth in London.\n What is the five-digit code you must dial to get in?\nAnswer:";<br>
cin>>Answer5;<br>
<b> if(Answer1=="Expecto Patronum" || Answer1=="expecto patronum" && Answer2=="Ronan" || Answer2=="ronan" && Answer3==11 && Answer4=="Fenrir Greyback" || Answer4=="fenrir greyback" && Answer5==62442)</b><br>
{<br>
cout<<"Congratulations "<<name<<" you had answer everything correctly!\n 'Yer a Potterhead, "<<name<<" .\n";<br>
cout<<"Thank you for playing "<<name<<", 'yer truly are a wizard. \n"<br><<endl;<br>
}<br>
<br>
} <br>
}<br>
}<br>
<br>
} <br>
<b>if(submit1== "no" || submit1=="NO" )</b><br>
{
cout<<" 'yer a squib then, "< }
if( answer1!="d" || answer1!="d." && answer2!="a" || answer2!="a."&& answer3!="b."|| answer3!="b" && answer4!="a."|| answer4!="a" && answer5!="a." || answer5!="a")
{
cout<<"I'm sorry there "< }
if(ANSWER1!="wolfsbane"|| ANSWER1!="WOLFSBANE"|| ANSWER1!="Wolfsbane" && ANSWER2!="grunnings"|| ANSWER2!="Grunnings" || ANSWER2!="GRUNNINGS" && ANSWER3!=150 && ANSWER4!=97 && ANSWER5!="Ordinary Wizarding Level" || ANSWER5!="ORDINARY WIZARDING LEVEL" )
{
cout<<" 'yer a squib then, "< }
} }
Aucun commentaire:
Enregistrer un commentaire