#include <iostream>
#include <string>
#include <sstream>
usingnamespace std;
long callPlayerChoice; //completed code
long playGame; //in progress
string playerName; //completed code
string playerAge; // completed code
long playerGender; //in progress
long Instructions; //in progress
long Quit; //completed code
int main()
{
cout << "Please enter a number for the task you want to complete." << endl << endl;
cout << "1) Play" << endl;
cout << "2) Instructions" << endl;
cout << "3) Quit" << endl;
cin >> callPlayerChoice;
cin.ignore(80,'\n');
if(callPlayerChoice == 1) playGame = 1;
elseif(callPlayerChoice == 2) Instructions = 2;
else Quit = 3;
if(Quit == 3)
{
system ("CLS");
cout << "Thanks for playing!!! Hope you enjoyed!!!" << endl;
cin.get();
}
if(Instructions == 2)
{
system ("CLS");
cout << "There are currently no instructions for this program." << endl;
cin.get();
}
if(playGame == 1)
{
system ("CLS");
cout << "Welcome to the game! Since you are starting on your journey," << endl;
cout << "let me know a little bit about you.";
cout << " What is your full name?" << endl << endl;
getline(cin,playerName);
cout << "Nice to meet you " << playerName << "." << endl;
cin.ignore(80,'\n');
system ("CLS");
cout << "How old are you?" << endl;
getline(cin,playerAge);
cout << "Nice, " << playerAge << ", thats the perfect age to start this journey. " << endl;
cin.ignore(80,'\n');
system ("CLS");
cout << "Please enter a number that corresponds to your gender." << endl << endl;
cout << "1) Male" << endl;
cout << "2) Female" << endl;
cout << "3) Neither" << endl;
cin >> playerGender;
cin.ignore(80,'\n');
if(playerGender == 1) playerGender = 'Male';
elseif(playerGender == 2) playerGender = 'Female';
else playerGender = 'Neither';
cout << "Welcome " << playerName << ", age " << playerAge << ", thats a perfect name for a " << PlayerGender << ", I wish you luck on your journey." << endl;
}
system ("PAUSE");
return 0;
}
playerGender is an integer type, and can't be used to store a string (line 65).
Why do you have 3 variables for the player's choice, each of which you assign a different number when you get their choice? Either test the variable containing their choice directly, or use 3 booleans.
I'm also a beginner, so maybe you shouldn't listen to what I have to say.
Still, I looked this over and couldn't figure out why you made gender a long when it could simply be an int, and your if statement needs to have an else for what would happen given an invalid value. If you want the pause at the end of your program, I agree with BlackSheep that you should never use system commands (we left batch files for this...) and instead end your program like this: