J
Jason Heyes
I want to write a class that supports operations on keywords belonging to
the C++ programming language. The following program repeatedly prompts the
user for a keyword until 'explicit' is finally entered:
#include <iostream>
#include "KeyWord.h"
int main()
{
KeyWord word;
while (std::cin >> word && word != "explicit");
return 0;
}
What would a class that supports the functionality of KeyWord in the above
program look like?What are the details of the implementation of such a
class? How many changes to the implementation would be required if another
set of keywords was to be used instead?
I would appreciate help in the form of code as well as discussion. Thanks.
the C++ programming language. The following program repeatedly prompts the
user for a keyword until 'explicit' is finally entered:
#include <iostream>
#include "KeyWord.h"
int main()
{
KeyWord word;
while (std::cin >> word && word != "explicit");
return 0;
}
What would a class that supports the functionality of KeyWord in the above
program look like?What are the details of the implementation of such a
class? How many changes to the implementation would be required if another
set of keywords was to be used instead?
I would appreciate help in the form of code as well as discussion. Thanks.