Hi! I need help! I need to create a program in c++ that ask a question, there is a multiple choice, display if your answer is wrong or correct. Like the gameshow "Who wants to be a millionaire" and included "LIFELINE"
I tried and it runs but when I chose "LIFELINE # 2" its also display the lifeline #1 and #3. and sometimes when i chose lifeline #1, it suddenly closed.
I'm so sorry i'm not really good about this. :'(
and sorry for my english. lol.
this is what i have done as of now >>:
#include<iostream.h>
#include<conio.h>
char ans;
char response;
int life;
int main()
{
clrscr();
cout<<"Who Wants to be a Millionaire?";
cout<<"Folder contains:?";
cout<<"a. Files";
cout<<"b. Foods";
cout<<"c. Animals";
cout<<"d. Stools";
getch();
cout<<"Do you want to use lifeline? Y/N: ";
cin>>response;
if(response=='y')
cout<<"1. 50-50";
cout<<"2. Call a friend";
cout<<"3. Ask the audience";
cout<<"Choose Lifeline [1-3]: ";
cin>>life;
{
if(life==1)
cout<<"50-50";
cout<<"a. Files";
cout<<"c. Animals";
{
if(life==2)
cout<<"Call a friend";
cout<<"Hi friend! I think the answer is letter B.";
cout<<"Im 89% sure. Good Luck!";
{
if(life==3)
cout<<"Ask the audience";
cout<<"The audience answers:";
cout<<"(a.) 52% (b.) 23% (c.) 13% (d.) 12%";
getch();
{ else if(response=='n')
cout<<"Your answer is: ";
cin>>ans;
switch(ans)
{
case 'a':
cout<<"a. Files";
getch();
cout<<"Correct!";
break;
case 'b':
cout<<"b. Foods";
getch();
cout<<"Wrong!";
break;
case 'c':
cout<<"c. Animals";
getch();
cout<<"Wrong!";
break;
case 'd':
cout<<"d. Stools";
getch();
cout<<"Wrong!";
break;
default:
cout<<"Invalid Choice!";
break;
}
getch();
return 0;
}}}}}}