Can Someone tell me what I am doing wrong I have tried my best with this program, please someone with a little more time on their hands so that they can take time to look at the program and Help! Thank you all for your time:)
#include <iostream>
#include <string>
#include <cctype>
using std::cout;
using std::cin;
using std::endl;
//function prototypes
void getItemNumber ();
void checkItemNumber (char *, int);
int main()
{
//declare variables
string Item = "";
getItemNumber();
checkItemNumber(item);
//call function to get input
//void getItemNumber ();
//void checkItemNumber (item);
cout << "Enter your 5-digit item #: ";
cin >> item;
while (item.length() != 5)
{
cout << "Invalid item #. Please enter a 5-digit item # ";
getline(cin, item);
}
if (item.length() == 5)
{
if ('B' == toupper(item[2]))
cout << "Your color is blue" << endl;
else if ('G' == toupper(item[2]))
cout << "Your color is green" << endl;
else if ('R' == toupper(item[2]))
cout << "Your color is red" << endl;
else if ('W' == toupper(item[2]))
cout << "Your color is white" << endl;
}
else
cout<< "Invalid name no matching color...";
// if code is not from any of the above.
system("pause");
return 0;
}