the code following this is my project. The getInfo() function will not return the information, that is one problem i have having. also anyone have a suggestion for a search function for this?
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
/////////////
//Prototypes
/////////////
void menu(int&);
void getInfo(string[], int[], string[], int[], int, const int);
void search();
void disSearch();
void disReport(string[], int[], string[], int[], const int);
void releaseInfo();
int main()
{
//Variables
int choice;
const int MAX = 2;
string guestName[MAX];
int claimNum[MAX];
string bellName[MAX];
int numBag[MAX];
//This will be the menu that contains the choices of storing
//releasing or viewing reports.
menu(choice);
if(choice == 1)
{
getInfo(guestName, claimNum, bellName, numBag, choice, MAX);
}
else if (choice == 2)
{
search();
}
else if (choice == 3)
{
search();
releaseInfo();
}
else if (choice == 4)
{
disReport(guestName, claimNum, bellName, numBag, MAX);
}
else if (choice == 5)
{
return 0;
}
else
{
cout << "Error!" << endl;
}
main();
search();
releaseInfo();
return 0;
}
///////////
//Functions
///////////
//these will contain the information to run the program.
void menu(int& tempChoice)
{
// getting users choice for program
cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl;
cout << "~~~~~~~~~~~~~~~~~~Menu~~~~~~~~~~~~~~~~~~~~~" << endl;
cout << "1. Store luggage " << endl;
cout << "2. Find luggage " << endl;
cout << "3. Release luggage " << endl;
cout << "4. View Totals Reports " << endl;
cout << "5. Exit. " << endl;
cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl;
cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl;
cin >> tempChoice;
while (tempChoice < 1 || tempChoice > 5)
{
cout << " Please choose 1, 2, 3, 4, or 5. " << endl;
cin >> tempChoice;
}
}
void getInfo(string tempguestName[], int tempclaimNum[], string
tempbellName[], int tempnumBag[], int tempchoice, const int MAX)
{
int i = 0;
while (tempchoice == 1)
{
cout << "Please enter the guest name. " << endl;
cin >> tempguestName[i];
cout << "Please enter the claim number." << endl;
cin >> tempclaimNum[i];
cout << "Please put your name. " << endl;
cin >> tempbellName[i];
cout << "Please put in how many bags." << endl;
cin >> tempnumBag[i];
i++;
cout << "Press 1 to enter another entry." << endl;
cin >> tempchoice;
}
return;
}
void search()
{
}
void disSearch()
{
}
void disReport(string guestName[], int claimName[], string bellName[], int numBag[$
{
int i = 0;
for (i = 0; i < MAX; i++)
{
cout << "guest name: " << guestName[i]<< endl;
cout << "Claim Number" << claimName[i]<<endl;
cout << "staff: " << bellName[i] << endl;
cout << "number of bags: " <<numBag[i] << endl;
}
}
void releaseInfo()
{
}