Failure to write a "class" structure will not work. The whole program should not be in main or after main in a modular programming format. 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.
Failure to write a "class" structure 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.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images