C++ program to design a class

Assignment Help Programming Languages
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.........

Reference no: EM13936329

Questions Cloud

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.

Reviews

Write a Review

Programming Languages Questions & Answers

  Explain the loops in detail

Even should only be reading for the FOR Loop. I tried moving it around and it won't work so I don't know how to fix it to not show on the DO..WHILE Loop and the WHILE Loop

  Differences between sql and procedural programming

Describe some of the differences between SQL and procedural programming languages such as C and VB

  Compute and display total number of votes received

Display the table with appropriate labels for the rows and columns. Compute and display the total number of votes received by each candidate and the percentage of the total votes cast.

  Program application to check donation amount

Additionally, program application to check that donation amount and number of donations are positive numbers. If either donation amount or number of donations is not positive value.

  Describe how to prepare users for sales organization unit

Describe how you would prepare the users for sales organization unit and how you can set up user groups in particular conditions (global, universal, domain local).

  Discuss the current business scenario of having a budget

Discuss the current business scenario of having a budget of $5000 to target. Can you envision a better strategy if the objective is to maximize the total profit from the campaign? Consider again what additional information you might want that shou..

  What are the advantages and disadvantages of a

what are the advantages and disadvantages of a manufacturing company owning and operating its own outbound warehouse

  Prepare a presentation on backgrounds and fonts

Can you still read the text? Is it too narrow or thick? Is an icon hidden by the background? You should also include tips for choosing backgrounds and fonts.

  Program display meal cost and tax amount

The program should then display the meal cost,taxAmt, and total bill respectively and use named constants Tax and tip to initialize the tax and the tip values.

  Do comments explain processing that is not obvious

When reviewing a program, these are the four criteria for style: Do identifiers logically describe use? Is indentation used correctly to illustrate the structure of the program?

  Poduce an html form with a textarea, text boxes n button

Produce an HTML form with a textarea, 5 text boxes and a button.Invite the user to type 10 or more characters in the textarea and then click the button.

  Display the gross earnings-tax payable using program

Print the gross earnings, tax payable, medical levy and net earnings for each employee. At the end of report, print total gross earnings, total tax, total medical levy and total net earnings.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd