Hello, I am brand new to C++. I'm making a basic little text-based adventure thing as one of my first projects, and I don't know how to make different answers to questions display different information.
For example, my code is asking if you accept the name you have entered. How do I make it so that if they say "yes" it goes onto the next bit of information or question, and if they say "no" it asks the question again?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <iostream>
usingnamespace std;
int main()
{
string name;
string yayornay;
cout << "Dungeons and Dragons" << endl;
cout << " " << endl;
cout << "This game is by Archie Kennedy." << endl;
cout << " " << endl;
cout << "State your name, Traveller!" << endl;
cin >> name;
cout << "" << name << ", huh?" << endl;
cout << "Do you accept the name " << name << "?" << endl;
cin >> yayornay;
}