!!!Failure to write a "class" structure(.h file) will not work. The whole program should not be in main or after main in a modular programming format.!!!
!!!Failure to write a "class" structure(.h file) will not work. The whole program should not be in main or after main in a modular
Project must be done in 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 non-negative 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.
Step by step
Solved in 5 steps with 4 images