Question: The language is C++ microsoft visual studio express. Design a class Numbers that can be used to translate whole dollar amounts in the range 0
The language is C++ microsoft visual studio express.
Design a class Numbers that can be used to translate whole dollar amounts in the range 0 - 9999 into an English description of the number. The class should have a single integer member variable int number; It should also have a collection of static string members that specify how to translate key dollar amounts into the desired format, for example you might use static strings such as
string lessThan20[ ] = {"zero", "one", ... "eighteen", "nineteen" };
string hundred = "hundred"; etc..
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 by writing a main program that asks the user to enter a number in hte proper range and then prints out the English description. This program should only accept the proper range of values.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
