Please help me make a checkpoint when there is a fork in the story!…

Question Answered step-by-step Please help me make a checkpoint when there is a fork in the story!… Please help me make a checkpoint when there is a fork in the story! Thank you for your time!’ #include using namespace std;int main() {   //array to hold at max 10 item that player can hold   string inventory[10];   //variable to count no of item in inventory currently   int ind = 0;   cout << "Please enter your name: ";   string username;   cin >> username;   cin.ignore();   cout << "Welcome to X Mark " << username << ". Will you find the treasure or Will you die trying? ";   cin.get();   int aboat;   cout << " You finely set sail to find the treasure, you see small sail boat " << endl << "and an old man, which do you choose." << endl;   cout << " 1 is the sail boat " << " 2 is the old man ";   cin >> aboat;   switch (aboat) {   case 1:       //assigning the item to inventory and incrementing the item count in the array       inventory[ind++] = “Boat”;       cout << "You choose to get into the boat and it happens to be booty trapped" << endl << " You have drowned" << endl;       cin.get();       cout << " ";       cin.get();       break;   case 2:       cout << "The old man sees you walking towards him ";       cout << "while you talk to him, he mentions that he saw someone set a trap within the boat";       cout << "Aren't you glad you didn't get into the boat, the old man also said that someone in town has the map to X MARK";       cout << "The townsfolk are passed out.";       cin.get();       cout << "you realise the boat has nothing in it and you get out";       cout << "the first thing you see is a deserted house ";       cout << "you decide to stay awile.";       cin.get();       cout << "in the distance you see something comin towards you...IT'S A PRIATES BOAT!";       cin.get();       cout << "It randomly sinks into the sand and pops out right next to the sunken lifeboat";       cin.get();       int pirate;       cout << "you see someone remergeing for the boat ... ITS A PIRATE" << endl;       cout << "do you hold still or hide in the house ";       cout << "pick 1 to hold still" << endl << " pick 2 to hide in the house";       cin >> pirate;       cin.get();       switch (pirate) {       case 1:           cout << "the pirate stares at you for what seems like forever then lets you aboard onto his ship and takes you to the other side of the island";           cin.get();           cout << "On the other side, you meet a guy named " << username << " which is turns out to be you.";           cin.get();           cout << "FROM THE FUTURE! and he hands you a riddle";           //adding riddle to inventory list           inventory[ind++] = "Riddle";           cin.get();           cout << " The riddle says, Pirates were sneaky, you could say they were crooks. To find the next clue, go to a room that has books? ";           cin.get();           cout << " You keep the riddle, hoping that it will soon assist you in your journey";           cout << " ";           cin.get();           break;       case 2:           cout << "You hide in the house.";           cin.get();           cout << "how do you plan on getting out of this place?" << endl << "o well lets get back to the story.";           cout << "so the Dinosaur saw you go into the motel so it starts bashing the wall" << endl << "you see an Assualt rifle in another room";           int weaponHold;           cout << " should you grab the rifle and shoot at the dinosaur or hide in the other room" << endl << "1 grab the rifle and shoot it" << endl << "2 hide";           cin >> weaponHold;           cin.get();           switch (weaponHold) {           case 1:               inventory[ind++] = “Riffle”;               cout << "So you grab the rifle at shoot at it with your M4." << endl << "its ineffective and the dinosaur chases you then you trip." << endl;               cin.get();               cout << "you almost get eaten by it but it trips over a pebble and squishes you like a fly.";               cin.get();               cout << " ";               break;           case 2:               cout << "You Dash into the room!";               cout << "the dinosaur oddly walks away." << endl << "you can't figure out why...";               cout << "THEN YOU TURN AROUND AND SEE YOUR NOT IN A MOTEL ITS A ALIEN AIRCRAFT CARRIER INSTEAD" << endl;               cin.get();               cout << "theres an aircraft in front of you";               cout << "1 hop into it" << endl << "2 wait" << "3 Run away";               int alien;               cin >> alien;               cin.get();               switch (alien) {               case 1:                   inventory[ind++] = “Alien Ship”;                   cout << "you fly the alien ship away" << endl << "Auto pilot is on and your going up to space" << endl;                   cin.get();                   cout << "turns out 3 species are fighting. Humans, Primarians, and the Renols" << endl;                   cout << "your in a Primarian ship. You begin to learn some controls then you see it" << endl;                   cin.get();                   cout << "A giant ship with a nuke headed towards it." << endl;                   cout << "It blows up and all out war starts!" << endl;                   cin.get();                   cout << "your now in dogfighting with some Renols. Yout take down like 3 of them";                   cout << "then another nuke comes in and blows everything up";                   cin.get();               case 2:                   cout << "You wait and get abducted by Human Scientist that make you help them find the launch code for several alien nukes" << endl;                   cin.get();                   cout << "then you get put in jail for helping terrorist" << endl << "at least you survived right?";                   cin.get();               case 3:                   cout << "the dinosaur sees you coming and runs you over";                   cin.get();               }           }       }   }   //printing the item hold by the player   cout << "n" << username << ", you have used the following : " << endl;   for (int i = 0; i < ind; i++) {       cout << (i + 1) << ". " << inventory[i] << endl;   }} Computer Science Engineering & Technology C++ Programming CSC 635 Share QuestionEmailCopy link Comments (0)