subject

Write a program that converts a number entered in roman numerals to decimal.

your program should consisit of a "class", say, romantype. an object of type romantype should do the following:

a. store the number as a roman numeral.

b. convert and store the number into decimal.

c. print the number as a roman numeral or decimal as requested by user.
the decimal values of the roman numerals are:
m=1000, d=500, c=100, l=50, x=10, v=5, i=1.

d. test your program using the following roman numerals: mcxiv, ccclix, mdclxvi

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
3. (6 pts) internally in the computer, with few exceptions, all numerical computation is done using binary numbers. output, however, often uses ascii, which is formed by appending 011 to the left of a bcd code. thus, an algorithm that directly converts a binary integer to a bcd integer is very useful. here is one such algorithm 1) draw lines to the left of the binary number to bound the expected bcd decades. (each decade is a group of 4 bits.) move the binary number one bit to the left. add 0011 to each bcd decade containing a binary value> 0100 repeat steps 2-3 until the last bit in the binary number has been moved into the least significant decade position. (note that when the last bit has been shifted into bcd decade, step 3 is not repeated.) read the bcd result. 2) 3) 4) 5) a) execute the algorithm for the binary number 1101101 b) execute the algorithm for the binary number 01110101110 4. (4 pts) represent the decimal number 3568 in bcd; excess-3 code; ascil; and hex.
Answers: 1
question
Computers and Technology, 22.06.2019 06:00
In outlook how can cherie look at the details of an event that appears on the month view of her calendar? check all that apply. by switching to the detail view by switching to the week view by switching to the day view by right-clicking on the event by double-clicking on the event by highlighting the event
Answers: 2
question
Computers and Technology, 23.06.2019 04:00
Laire writes a letter to her grandmother, in which she describes an amusement park she visited last week. she adds pictures of that place in her letter. which feature of a word processing program will claire to remove unwanted parts of the pictures?
Answers: 3
question
Computers and Technology, 23.06.2019 09:00
Which best describes the role or restriction enzymes in the analysis of edna a. to break dna into fragments that vary in size so they can be sorted and analyzed b. to amplify small amounts of dna and generate large amounts of dna for analysis c. to purify samples of dna obtained from the environment so they can be analyzed d. to sort different sizes of dna fragments into a banding pattern that can be analyzed
Answers: 1
You know the right answer?
Write a program that converts a number entered in roman numerals to decimal.

your progr...
Questions
question
Social Studies, 26.04.2021 06:30
question
Mathematics, 26.04.2021 06:30
question
Mathematics, 26.04.2021 06:30
question
Mathematics, 26.04.2021 06:30
question
Mathematics, 26.04.2021 06:30
question
Biology, 26.04.2021 06:30