Reference no: EM13936329
Design a class Numbers that can be used to translate whole dollar amounts in the range 0 through 9999 into an English description of the number. For example, the number 713 would be translated into the string seven hundred thirteen, and 8203 would be translated into eight thousand two hundred three. The class should have a
single integer member variable: int number; and a static array of string objects that specify how to translate key dollar amounts into the desired format. For example, you might use static strings 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 by writing a main program that asks the user to enter a number in the proper range and then prints out its English description.
Below is how the code would display:
This program translates whole dollar amount into words for the purpose of writing checks.
Entering a negative number terminatesthe program.
Enter an amount for be translated into words:<0-9999>1234
One thousand two hundred thirty four
Enter another number 0-9999:<negative number to stop> -3456
Press any key to continue.........
Determine the average number of probes that each search algo
: Determine the average number of probes that each search algorithm took. Do these values represent the theoretical values? Print out the averages for the two searches and their theoretical values.
|
Describe legal issues in operation of international banking
: Describe the legal and ethical issues in the operation of international banking and reflect on how these contributed to the downfall of the capital market and its effect it may have on investments in Costa Pobre.
|
Fryer inc owns equipment for which it paid 90 million
: Fryer, Inc., owns equipment for which it paid $90 million. At the end of 2011, it had accumulated depreciation on the equipment of $27 million. Due to adverse economic conditions, Fryer's management determined that it should assess whether an impairm..
|
Discuss the media release and newspaper article
: Discuss the Media Release and newspaper article in the context of the statement "regulation is the output of a political process". Do you agree or disagree?
|
C++ program to design a class
: 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 by writi..
|
Preparing and analyzing financial statements
: As the CFO of your corporation, you are in charge of preparing and analyzing financial statements that will be presented to potential investors and creditors
|
What is expected relation between relative interest rates
: Effects of real interest rates. What is the expected relationship between the relative real interest rates of two countries and the exchange rate of their currencies?
|
C# program to encrypt the letters
: Consider this, the word is FEATHER. Remove duplicate letters, making FEATHR, and append the rest of the letters of the alphabet in reverse order.
|
Ensure data stored on file servers
: Implement and install a website for a hospital. Needs to write an article that shows the WEBSITE DEVELOPMENT. Check and maintain the software which is installed in the network devices.
|