So I am writing code for a simulator. It's been a few months since I've coded and I'm really rusty. I am trying to do an if / else if statement and when I run it and get to the part where I choose either "Military, Culture, or Science" and enter one option in the program just finishes and doesnt move on. Please help and tell me what I am doing wrong/how to fix it! Thanks!
#include <iostream>
#include <string>
usingnamespace std;
string empirename;
char Military;
char Government;
char Science;
char Culture;
char Option;
int main(int argc, constchar * argv[])
{
cout << "Hello, welcome to empire simulator. To start please choose a name for your new empire! Type it in below.";
cin >> empirename;
cout << "Alright welcome to your new empire named " << empirename << ". Now that you have your new empire, what areas would you like to focus it on? You can choose to focus it on the following: Military, Government, Science, Culture. ";
cin >> Option;
if (Option == Military) {
cout << "Test1";
}
elseif ( Option == Government )
{
cout << "Test2";
}
elseif (Option == Science)
{
cout << "Test3";
}
};
#include <iostream>
#include <string>
usingnamespace std;
string empirename;
string Military;
string Government;
string Science;
string Culture;
string Option;
int main()
{
cout << "Hello, welcome to empire simulator. To start please choose a name for your new empire! Type it in below.";
cin >> empirename;
cout << "Alright welcome to your new empire named " << empirename << ". Now that you have your new empire, what areas would you like to focus it on? You can choose to focus it on the following: Military, Government, Science, Culture. ";
cin >> Option;
if (Option == "Military") {
cout << "Test1";
}
elseif ( Option == "Government" )
{
cout << "Test2";
}
elseif (Option == "Science")
{
cout << "Test3";
}
};