Design a class numbers that can be used to translate

Assignment Help C/C++ Programming
Reference no: EM132194191

Question: Numbers Class

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 then prints out its English description.

Reference no: EM132194191

Questions Cloud

Define ethics within the context of digital forensics : For this assignment, you will define ethics within the context of digital forensics. You will then apply what you learned to your life, developing an ethical.
What kind of data does it generate : Select a research method that is appropriate to use to answer your question. Explain the research method that you have selected. · What steps are involved? ·
Legislation pertaining to the minority group : Describe relevant legislation pertaining to the minority group.
What do you see as the biggest issue in the middle east : What do you see as the biggest issue in the Middle East and why? How does this issue affect the world currently and what do you think are the issues
Design a class numbers that can be used to translate : 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.
Describe a significant and material event missed by planned : What term is used to describe a significant and material event missed by planned that should have, in retrospect, been known and predictable?
Determine the new price of a movie ticket : For each of the annual inflation rates given in the following table, first determine the new price of a movie ticket, assuming it rises at the rate of inflation
Positive culture enhance a firm''s competitive advantage : Briefly explain, How can a strong, positive culture enhance a firm's competitive advantage?
Strong leisure orientation : If a person knew that group members all had a "strong leisure orientation," how would that help this person does a better job as a manager?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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