C++
// Federico Palafox #include<iostream> #include<string> using namespace std; int basement(int battery) { cout << "You have never been in the basement before but you see that there is a sign that tells you where the main basement office is and there is a hallway to the left and to the right." << endl ; int answer; battery = 0; do { cout << "Where do you want to go (1) for the main office (2) for the left of the hallway (3) for the right of the hallway, in order to look for anyone that you might ask for batteries." << endl ; cin >> answer; if(answer == 1) { cout << "You go to the main office where the Secretary says:'Hello there how can i help you' you:'Hello would you happen to have any spare batteries around here?' Secretary:'yes of course' she goes to check and finds only one,you: Do you happen to have any more?, Secretary:'You might want to take a look around in the hallways.' you:'alright sounds great thanks." << endl; battery++; } if(answer == 2) { cout <<"You go to the left and you see a janitor and you ask him if he has spare batteries on him or in his janitor room, he says he will look, you go with him and he cant find anything you tell him thank you and to have a great day" << endl; } if(answer == 3) { cout <<"You go to the right side of the hall way and you find a professor and you ask him if he knows anyone or if he has an extra spare battery, instantly he say he has one, you follow him to his office and he gives you the spare battery he had laying around, you say thank you ." << endl; battery++; } }while(battery != 2); return battery ; }