Hi again.
In one of my programs, I would like to put in a search type feature. I would like it, so if the user enters a book name, it returns the call number of the book. I would also like it ti display a message if the library doesn't have this book.
The way I have it is problematic because it looks like this:
int searchEngine()
{
string name;
string number;
cout << "Enter the name of a book: \n";
cin >> name;
[INDENT]if ( name == "BillyBob")
{
[INDENT]number = "CAL 123.45";[/INDENT]
}
//Then LOTS more of the if statements
//followed by...
else
{
[INDENT]cout << "The library doesn't own this book!\n";[/INDENT]
}
[/INDENT]
}
That would make my code huge, and the task would be tedious. Is there any way to get all of this code shortened or off site into a .h file?