Hi! I need help to my c++ program. I created a program that is much like the "Who wants to be a Millionaire" television show. It has questions and the right answers and three lifelines. How can I possibly do eliminate a lifeline after being used.?
this is the program I created so far:
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
char name[50];
char ans;
char ask;
int life;
int main()
{
clrscr();
cout<<"Your Name: ";
cin>>name;
getch();
clrscr();
cout<<"Who Wants to be a MILLIONAIRE?";
cout<<"LIFELINE";
cout<<"1. 50:50";
cout<<"2. Call a friend";
cout<<"3. Ask the audience";
cout<<"QUESTION 1:";
cout<<"Who discovered Computer?";
cout<<"a. Charles Darwin";
cout<<"b. Charles Babbage";
cout<<"c. Isaac Newton";
cout<<"d. Abraham Lincoln";
getch();
cout<<"Do you want to use your lifeline?";
cout<<"[ Y/N : ] ";
cin>>ask;
if(ask=='y')
{
cout<<"Choose Lifeline Number: ";
cin>>life;
if(life==1)
{
cout<<"[ 50:50 ]";
cout<<"_________";
cout<<"c. Isaac Newton";
cout<<"b. Charles Babbage";
cout<<"_________";
getch();
}
else if(life==2)
{
cout<<"[ Call a friend ]";
cout<<"Friend: I think it is B";
getch();
cout<<"You: How sure are you?";
getch();
cout<<"Friend: I'm 95% sure about this.";
getch();
}
else if(life==3)
{
cout<<"[ Ask the audience ]";
cout<<"(a.) 23% (b.) 52% (c.) 13% (d.) 12%";
getch();
}
}
else if(ask=='n')
getch();
cout<<"Your answer is: ";
cin>>ans;
if(ans=='b')
{
cout<<"You're Right!";
getch();
cout<<"You just won $20,000!!!";
getch();
cout<<"Get ready for the next round!";
}
else
{
cout<<"Wrong!";
cout<<"Try again";
getch();
exit(0);
}
getch();
clrscr();
cout<<"Who Wants to be a MILLIONAIRE?";
cout<<"LIFELINE";
cout<<"1. 50:50";
cout<<"2. Call a friend";
cout<<"3. Ask the audience";
cout<<"QUESTION 2:";
cout<<"Folder contains...?";
cout<<"a. Foods";
cout<<"b. Animals";
cout<<"c. Clothes";
cout<<"d. Files";
getch();
cout<<"Do you want to use your lifeline?";
cout<<"[ Y/N : ] ";
cin>>ask;
if(ask=='y')
{
cout<<"Choose Lifeline Number: ";
cin>>life;
if(life==1)
{
cout<<"[ 50:50 ]";
cout<<"a. Foods";
cout<<" _________";
cout<<" _________";
cout<<"d. Files";
getch();
}
else if(life==2)
{
cout<<"[ Call a friend ]";
cout<<"Friend: I think it is D";
getch();
cout<<"You: How sure are you?";
getch();
cout<<"Friend: I'm 95% sure about this.";
getch();
}
else if(life==3)
{
cout<<"[ Ask the audience ]";
cout<<"(a.) 23% (b.) 12% (c.) 13% (d.) 52%";
getch();
}
}
else if(ask=='n')
getch();
cout<<"Your answer is: ";
cin>>ans;
if(ans=='d')
{
cout<<"You're Right!";
getch();
cout<<"You just won $50,000!!!";
getch();
cout<<"Get ready for the next round!";
}
else
{
cout<<"Wrong!";
cout<<"Try again";
getch();
exit(0);
}
getch();
}