Program that stores and converts a number

Assignment Help Computer Engineering
Reference no: EM1326863

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: EM1326863

Questions Cloud

Counter-argument to training leaders : A third possibility is that, even if certain theories could actually guide individuals in leadership situations and even if individuals could alter their style. What is your reaction to these arguments?
Students explore the reasons behind regulating banks : In the particular assignment due this week, students explore the reasons behind regulating banks also how that regulation relates.
Develop an application with the chosen dbms : A school intends to procure the integrated student management application holding all details of registered students including personal information, courses taken, and examination grades.
Discussing law of hire-purchase : Karim bought a second hand Toyota Hilux from Jamin Baik Sdn Bhd. On 15 January 2012, he signed a hire-purchase agreement for the car with OUR Bank.
Program that stores and converts a number : Write down a program that stores and converts a number entered in Roman numerals to an integer value. Your program should consist of a class named Roman.
Supply assistance to nation experiencing economic : The International Monetary Fund IMF supply assistance to nation experiencing economic woes.
Debate the moral responsibility of one agent : Debate the moral responsibility of one agent (Computer Programmer) associated with the two Therac-25 overdoses which occurred in Tyler, Texas.
Explaining moral leadership qualities : Do the means they choose also reflect on their moral leadership qualities?
Explaining the cars-r-us : Cars-R-Us (Cars) has several truck and car manufacturing plants throughout the United States. All its plants are unionized.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Produce a book class that stores book information

Produce a Book class that stores book information

  C program to implement sieve of erastosthenes

Prepare a C program which implements the Sieve of Erastosthenes and determines the primes among the first N integers that you enter through a prompt or the command line.

  Decision making systems

How we may leverage business intelligent to generate meaningful information and decision making systems in order to help the keep cost and the profits.

  Explain interval and arithmetic coding

Evaluate the cumulative distribution function and the binary intervals

  Write a java program that creates an array of integers

Write a java program that creates an array of integers

  How to exchange the floating point number

How to exchange the floating point number

  Write down a short assembly language module

Write down a short assembly language module

  Data integration and etl

Write down the data integration and ETL. How are they related? What is the data warehouse and state its benefits?

  Write down an automated checkout program

Write down an automated checkout program

  Sorting the array

Write down a program which stores lists of the names (the last name first) and ages in parallel arrays and sorts names into alphabetical order keeping the ages along with the correct names.

  Program to perform the different arithmetic operations

Write down a Ruby program that continuously reads in the number, x, from the screen, and then computes and displays its: Factorial, if x is less than 15; Fourth power, if 15 35.

  Recognizing the threats in the code

State two recent virus threats; whether they are minor or the major threats?

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