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

  Is there the standard for drc

I would like to ask a question about Disaster Recovery Site Certification? Is there certification for DRSC for computers and application? Is there a standard for DRC.

  Plan the decision table with all possibilities

Plan the decision table with all possibilities

  Prepare a use case diagram

Prepare a Use Case Diagram based on the given problem description.

  Type of connections in elevator shaft

Describe what type of connections would work within the elevator shaft. If more than one choice is possible, choose the best option and describe the reasons for your choice.

  Program to determine persons body mass index

Develop a program which determines a person's body mass index. Develop the modular program which determine and display a person's body mass index (BMI).

  What are the major problems of nrz

What are the major problems of NRZ (Non-Return to Zero) encoding/signaling? Is there any case where it's use could be acceptable? explain.

  Describe what java environment contain to pass an arraylist

Describe what Java environment contain to pass an ArrayList

  Sketch a basic network suggesting how many routers

plan a basic network suggesting how many routers and hubs etc for each floor. As well, find out what to use to connect i.e. Cat5 wire,etc.

  Cloud to provide crm installations

What "Cloud" can provide to the CRM installations in order to ease the adoption of such systems?

  Cityquery and productquery

Create a report by the city and another by the product, involving details of sales and sub-totals and totals for the quantity.

  What is mflops rating of the system

What is MFLOPS rating of the system

  Predicate color and action paint using situation calculus

Predicate color and action paint using situation calculus

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