question archive Using C++ Design a class called Numbers that can be used to translate integers in the range 0 to 9999 into an English description of the number
Subject:Computer SciencePrice:2.87 Bought7
Using C++
Design a class called Numbers that can be used to translate integers in the range 0 to 9999 into an English description of the number.
The class should have a single integer member variable:
int number;
and a static array of string objects that specify how to translate the number into the desired format. For example, you might use static string arrays such as:
string lessThan20[20] = {"zero", "one", ..., "eighteen", "nineteen"};
string hundred = "hundred";
string thousand = "thousand";
The class should have a constructor that accepts a nonnegative integer and uses it to initialize the Numbers object. It should have a member function, print(), that prints the English description of the Numbers object.
Demonstrate the class in a main program that prompts the user to input a number and then prints out its English description.
Purchased 7 times