bettermanlamia
Programmer
ok. i made a small ...small SMALL msdos program with Visual C++ express (yep a newbie) and all it was, was a whats ur name age and if u like this kind of music or game.
now i figured out the whole press one if u like this or press 2 for no. but i want to make it a says YES FOR YES! and so on. get it?
good.
here's my code.
im really stuck
#include <iostream>
using namespace std;
int main()
{
int number; /* This describes the number int. */
char conversation1[256];
int halo;
char variable = 2;
char option;
cout << "Welcome To the computer talking program.\n";
cout << "This Program is just a beta.\n";
cout << "Press the enter key to begin..";
cin.get();
cout << "\nHello How old are you? ";
cin >> number; /* Now the number "INT" is entered here. and used */
cin.ignore(); /* cin.ignore(); its a ignore feature, that ignores the enter */
/* button when you hit it so it doesn't close the program */
cout << " So your " << number << ".\n";
cout << "\nI'm 24. \n Just got done with college.\n The classes were hard, but it was worth it. ";
cout << "\n Just a few more months and I'll be 25.\n";
cout << "\nSo what's your name? ";
cin.getline ( conversation1, 256, '\n' );
cout << " So your name is " << conversation1 << ".\n";
cout << " My name is Ibanez Bam Mandez.\n You can call me IBM. ^_^\n";
cout << "\nSo how's life been? ";
cin.getline ( conversation1, 256, '\n' );
cout << " Well that's " << conversation1 << ".\n";
cout << "So do you like video games? \n 1 for yes. 2 for no: ";
cin >> option;
if (!strcmp(option, "yes"))
variable = 1;
switch (variable)
{
case 1 :
cout << "Kewl.\n";
cout << "\n Hit enter to continue..";
cin.get();
break;
case 2 :
cout << "Aww.\n";
cout << "\n Hit enter to continue..";
cin.get();
break;
case 0 :
cout << "Okay.\n";
cout << "\n Hit enter to continue..";
cin.get();
break;
}
cin.get();
cout << "\n So have you ever played Halo? ";
cin >> halo;
switch (halo)
{
case 1 :
cout << "Awesome. Me 2.\n I love Halo.";
cin.get();
break;
case 2 :
cout << "Eh ok.\n";
cin.get();
break;
case 0 :
cout <<" Mmmk.\n";
cin.get();
break;
}
cout << "\n Well gtg peace";
cin.get();
}
now i figured out the whole press one if u like this or press 2 for no. but i want to make it a says YES FOR YES! and so on. get it?
good.
here's my code.
im really stuck
#include <iostream>
using namespace std;
int main()
{
int number; /* This describes the number int. */
char conversation1[256];
int halo;
char variable = 2;
char option;
cout << "Welcome To the computer talking program.\n";
cout << "This Program is just a beta.\n";
cout << "Press the enter key to begin..";
cin.get();
cout << "\nHello How old are you? ";
cin >> number; /* Now the number "INT" is entered here. and used */
cin.ignore(); /* cin.ignore(); its a ignore feature, that ignores the enter */
/* button when you hit it so it doesn't close the program */
cout << " So your " << number << ".\n";
cout << "\nI'm 24. \n Just got done with college.\n The classes were hard, but it was worth it. ";
cout << "\n Just a few more months and I'll be 25.\n";
cout << "\nSo what's your name? ";
cin.getline ( conversation1, 256, '\n' );
cout << " So your name is " << conversation1 << ".\n";
cout << " My name is Ibanez Bam Mandez.\n You can call me IBM. ^_^\n";
cout << "\nSo how's life been? ";
cin.getline ( conversation1, 256, '\n' );
cout << " Well that's " << conversation1 << ".\n";
cout << "So do you like video games? \n 1 for yes. 2 for no: ";
cin >> option;
if (!strcmp(option, "yes"))
variable = 1;
switch (variable)
{
case 1 :
cout << "Kewl.\n";
cout << "\n Hit enter to continue..";
cin.get();
break;
case 2 :
cout << "Aww.\n";
cout << "\n Hit enter to continue..";
cin.get();
break;
case 0 :
cout << "Okay.\n";
cout << "\n Hit enter to continue..";
cin.get();
break;
}
cin.get();
cout << "\n So have you ever played Halo? ";
cin >> halo;
switch (halo)
{
case 1 :
cout << "Awesome. Me 2.\n I love Halo.";
cin.get();
break;
case 2 :
cout << "Eh ok.\n";
cin.get();
break;
case 0 :
cout <<" Mmmk.\n";
cin.get();
break;
}
cout << "\n Well gtg peace";
cin.get();
}