int NumWords = wholeList.getNumWords();
int num;
char choice;
cout << "FILE NAME: " << fileN << endl;
cout << "CHAR NUM: " << charNum << endl;
cout << "LINE NUM: " << lineNum << endl;
cout << "Menu Choices:" << endl;
cout << "A)ll Words with Multiplicity" << endl;
cout << "P)rint Words That Appeared a Specified Number of Times" << endl;
cout << "S)how first N Characters of All Words" << endl;
cout << "F)ind a Word" << endl;
cout << "Q)uit" << endl;
do {
cout << "Please enter a number. Enter negative number to exit. >> " << endl;
cin >> choice;
switch (choice) {
case"A":
cout << setw(20) << "WORD" << setw(20) << "COUNT" << endl;
//for (int i = 0; i < NumWords; i++) {
//output all the words and their multiplicity
cout << wholeList << endl;
case"a":
cout << setw(20) << "WORD" << setw(20) << "COUNT" << endl;
//for (int i = 0; i < NumWords; i++) {
//output all the words and their multiplicity
cout << wholeList << endl;
break;
case"P":
//output particular words of specified multiplicity
cout << setw(20) << "WORD" << setw(20) << "COUNT" << endl;
for (int i = 0; i < NumWords; i++) {
if (wholeList.getWordMult(i) == num) {
cout << wholeList[i];
}//if delimiter
}//for loop delimiter
case"p":
//output particular words of specified multiplicity
cout << setw(20) << "WORD" << setw(20) << "COUNT" << endl;
for (int i = 0; i < NumWords; i++) {
if (wholeList.getWordMult(i) == num) {
cout << wholeList[i];
}//if delimiter
}//for loop delimiter
break;
case"F":
cout << "Please enter the word you wish to find:" << endl;
string FindWord;
cin >> FindWord;
for (int i = 0; i < NumWords; i++) {
if (FindWord == wholeList[i].getWord())
cout << wholeList[i].getWord();
}
case"f":
cout << "Please enter the word you wish to find:" << endl;
string FindWord;
cin >> FindWord;
for (int i = 0; i < NumWords; i++) {
if (FindWord == wholeList[i].getWord())
cout << wholeList[i].getWord();
}
case"Q":
cout << "You have entered a "Q" - program will terminate." << endl;
exit(0);
case"q":
cout << "You have entered a "Q" - program will terminate." << endl;
exit(0);
default:
cout << "You have entered an invalid entry." << endl;
}//case stment delimiter
} while (num >= 0);
When I compile it I get these errors:
p3.cpp:194: error: case label does not reduce to an integer constant
p3.cpp:200: error: case label does not reduce to an integer constant
p3.cpp:208: error: case label does not reduce to an integer constant
p3.cpp:217: error: case label does not reduce to an integer constant
p3.cpp:229: error: case label does not reduce to an integer constant
p3.cpp:239: error: case label does not reduce to an integer constant