#include <iostream>
#include <string>
using namespace std;
//char inventoryRequest = 'i';
//Function Definitions.
void exitGame();
int playGame();
int main()
{
//Menu Text.
cout<< "\t******Menu******\n\n";
cout<< "Please choose one of the following:\n";
cout<< "1 -Play Game.\n";
cout<< "2 -Exit.\n";
int choice;
cout<< "Choice: ";
cin>> choice;
string name;
switch (choice)
{
//Menu 1 choice.
case 1:
playGame();
break;
//Menu 1 choice.
case 2:
exitGame();
break;
default:
cout<< "That is not a choice!!!\n";
}
getchar();
getchar();
return 0;
}
//Method for play game.
int playGame()
{
//string inventory[10];
//inventory[0] = "stick";
//inventory[1] = "rock";
string name;
int age;
char sex;
cout<< "What is your name?\n";
cin>> name;
cout<< "What is your age?\n";
cin>> age;
cout<< "What is your sex, M or F?\n";
cin>> sex;
cout <<"Name:"<< name<<" Age:" << age<< " Sex:"<< sex;
cout << "\n\nIt is a cold and rainy night on board the Viking ship that is bringing " << name <<" to his terror.";
return 0;
}
void exitGame()
{
}
int inventory()
{
char input[80];
cin >> input;
char inventoryRequest[] = "i";
int invent;
//compare the player input to inventaryRequest (i) to see if they want to look at inventarty
//invent = strcmp (input,inventaryRequest );
//char Input[80];
do {
printf ("Guess my favourite fruit? ");
gets_s (input);
} while (strcmp (input,inventoryRequest) != 0);
if(invent = 0)
//int i = displayInvent();
return 0;
}
int displayInvent()
{
string inventory[10];
inventory[0] = "stick";
inventory[1] = "rock";
for(int i = 0;i < inventory.size();i++)
cout << inventory[i];
}
pendo826 0 Light Poster
skaa 0 Light Poster
pendo826 0 Light Poster
Fbody 682 Posting Maven Featured Poster
pendo826 0 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.