I'm making a simple police-style terminal to be put into a game. I want to be able to type in a name (without any formatting concerns) and have a status (Wanted Y/N, Valid DL Y/N) put out by the program. Here's what I have so far, although I know it doesn't work. Can anyone help with this, or is it a lost cause?
// Police Radio.cpp : main project file.
#include <iostream>
#include <string>
#include <ctime>
#include <sstream>
usingnamespace std;
int main()
{
string nam;
// nam is a string since you're looking for a name, not a number
int response;
// response is for a random number, 0 to 3
string status[4] = {"WANTED: NO, VALID DL: NO", "WANTED: NO, VALID DL: YES", "WANTED: YES, VALID DL: NO", "WANTED: YES, VALID DL: YES"};
// char is for single characters
cout << "ENTER A NAME TO SEARCH FOR \n";
cin >> nam;
srand(static_cast<int>(time(0))); // seed the random number generator
response = rand()%4;
cout << status[response] << endl;
cin.get();
system("PAUSE");
}