Question
Using C++ language As a software programmer in a financial institution, you have been asked to develop a program that converts dollar amounts between $0
Using C++ language
As a software programmer in a financial institution, you have been asked to develop a program that converts dollar amounts between $0 and $9,999 from numbers to words. The program will only accept whole numbers. For instance, it takes $815 and converts it into eight hundred fifteen.
Design a class called Converter to be used in this program. The class should have one integer member variable; int value, and a static array of string objects that specifies how to convert dollar amounts into the desired format. For example:
string below20[20] =
{"zero", "one", ..., "eighteen", "nineteen"};
string hundreds = "hundred;
string thousands = "thousand";
The Converter class will include a constructor that accepts a nonnegative integer to initialize the Converter object. The class will also include a member function display() that displays the word description of the Converter object. The class will be used in a main function that asks the user to enter a number within the specified range and then displays the word description.
// Please show me the sample output
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started