Program to convert number to words

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

Write a program that stores and converts a number entered in Roman numerals to an integer value. Your program must consist of a class named Roman. An object of type Roman must do the following:

1.) Store the number as a Roman numeral,

2.) Convert and store the number also as an integer value,

3.) Print the number as a Roman numeral or integer number as requested by a method call,

4.) Implements a constructor.

So for example, you should be able to write a program that looks something like this:

Roman r = new Roman("MCXIV");

r.printInt(); //prints 1114

r.printRoman(); //prints MCXIV

Roman s = new Roman("CCCLIX");

s.printInt(); //prints 359

The Roman numerals are:

I = 1

V = 5

X = 10

L = 50

C = 100

D = 500

M = 1000

Reference no: EM13946213

Questions Cloud

Identify the full name of the author : Author and title: Identify the full name of the author and the title of the work. Genre: What type of writing is it (op-ed, newspaper article, magazine article, speech, book Excerpt, other)? What's it for
Should the manufacturer pay for an opinion : Calculate the breakeven point in sales dollars using the contribution margin ratio approach. How many pizzas must be sold to earn $60,000 profit per annum before tax?
Electrical heater of problem : Consider the electrical heater of Problem 7.49. If the blower were to malfunction, terminating airflow while the heater continued to operate at 1000 W/m, what tem- perature would the heater assume?
Common practice in chemical processing plants : Common practice in chemical processing plants is to clad pipe insulation with a durable, thick aluminum foil. The functions of the foil are to confine the batt insulation and to reduce heat transfer by radiation to the surroundings.
Program to convert number to words : Write a program that stores and converts a number entered in Roman numerals to an integer value. Your program must consist of a class named Roman.
Evaluate properties-appropriate film temperature : Consider the hot water pipe of Problem 7.56, but under convection coefficient as a function of only !iT = Ts - Too, where Ts is the sensor temperature. Evaluate properties at an appropriate film temperature and show what effect this approximation ..
Finite-difference method of solution : Use the finite-difference method of solution to obtain qf when the convection and radiation coefficients are based on local, rather than average, tem- peratures for the fin. How does your result compare with the analytical solution of part (a)?
Identify two risks in each of these strategies : Buy a system created for another school and modify it to fit this school's specific requirements
Estimate the surface temperature : An electric immersion heater, 10 mm in diameter and 300 mm long, is rated at 550 W. If the heater is horizon- tally positioned in a large tank of water at 20°C, estimate its surface temperature. Estimate the surface temperature if the heater is ac..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Differences between a while loop and a do-while loop

What are the differences between a while loop and a do-while loop?

  How does the choice affect the user of the class

Write a partial C++ class definition not implementation that contains the public interface of the Date class described in Exercise R9.2.

  Write program to calculate net pay for factory worker

Write and run a program in C++ that calculates the net pay for a factory worker. The program prompts the user for skill level and hours worked, as well as appropriate insurance and retirement options for the employee's skill.

  Write a function named totamt

Write a function named totamt() that uses four parameters named quarters, dimes, nickels, and pennies, which represent the number of each of these coins in a piggybank.

  Prompt the user to enter the total capacity of the cage.

Determine when the farmer will have to separate the bunnies in order to prevent the birth of any more.

  Generates a random number and asks the user

Write a program in c++ that generates a random number and asks the user to guess what the number is. If the user's guess is higher than the random number

  Write a test program that creates an account object

Write a test program that creates an Account object with an ID of 1122, a balance of 20000USD, and an annual interest rate of 4.5% - Use the withdraw method to withdraw 2.500USD, use the deposit method to deposit 3000USD and print the balance, mont..

  Define the class bankaccount

Define the class bankAccount to implement the basic properties of a bank account. An object of this class should store the following data: Account holder's name (string), account number (int), account type (string, checking/saving), balance (double),..

  Build a grade performance record and prediction tool

You are to build a grade performance record and prediction tool for your course. This tool shall record the individual grades of a student

  Prepare a a simple class fraction

Web tickets are purchased on the internet. Web tickets purchased a week in advance of the event are £30 and those purchased less than a week in advance are £40.

  A company hired 10 temporary workers

A company hired 10 temporary workers who are paid hourly and you are given a data file that contains the last name of the employees, the number of hours each employee worked in a week, and the hourly pay rate of each employee.

  Write a parallel program with the sequent simulator

Complete the following program to write a parallel program with the Sequent Simulator for the following task: Hire two processors. One processor searches the first half of a array and finds the largest number. The second processor searches the sec..

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