I am a beginner... and me and my friend are making little "manuals" based on a fantasy novel we are writing. He is doing it in java while I am doing it in C++. Enough backstory, here is the issue:
So, all I need to know is the proper way to do an if statement to use to answer questions and display info based on user input. Based on this source code, what would you suggest?
//The Magical Manual Main file
#include <iostream>
//Namespaces
usingnamespace std;
int main()
{
string input = "";
cout << "Mystrian Magic Manual 1.0" << endl;
cout << "Programmed by James Bryce in C++..." << endl;
cout << "the co-author of the Mystrian Fate series!" << endl;
getline (cin, input);
cout << "Welcome!\n" << endl;
cout << "AI boot complete!\n" << endl;
cout << "Hello! I am a digital copy of Xhalite," << endl;
cout << "the White Wizard of the element: Earth." << endl;
cout << "Pick a topic:\n" << endl;
cout << "a) Magical Animals" << endl;
cout << "b) Spell Lists" << endl;
cout << "c) History" << endl;
cout << "d) Alchemy" << endl;
cout << "e) Herblore" << endl;
cout << "f) Locations" << endl;
cout << "g) Religions" << endl;
cout << "h) People/Races" << endl;
cout << "i) Exit" <<endl;
getline (cin, input);
return 0;
}
Also there will be many sub sections and a lot of information, but if you tell me how to do an if statement for any one of these I should be able to get the hang of it and figure out the rest.
And I need to be able to have a way for user to exit or return to beginning. So information on that would be helpful! Thanks!