3. Write a recursive C++ program that returns the English integer equivalent of a roman numeral...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
3. Write a recursive C++ program that returns the English integer equivalent of a roman numeral given a method with a string argument. Use the standard Roman numeral values: M, D, C, L, X, V, and I. Remember, no more than three of the same letters can be used consecutively in a Roman numeral. For example, the number three is expressed as III, the number four must be expressed as IV. Values can only be between 1-3000. Use recursive method for your calculation, and recursion must be used for full credit. Refer to the sample output below. Sample Runs (2): Enter a positive value: 1345 The Roman numeral equivalent is: MCCCXLV Enter a positive value: 9 The Roman numeral equivalent is: IX Name the program: RecRomanCovertXX.cpp, where XX are your initials. 3. Write a recursive C++ program that returns the English integer equivalent of a roman numeral given a method with a string argument. Use the standard Roman numeral values: M, D, C, L, X, V, and I. Remember, no more than three of the same letters can be used consecutively in a Roman numeral. For example, the number three is expressed as III, the number four must be expressed as IV. Values can only be between 1-3000. Use recursive method for your calculation, and recursion must be used for full credit. Refer to the sample output below. Sample Runs (2): Enter a positive value: 1345 The Roman numeral equivalent is: MCCCXLV Enter a positive value: 9 The Roman numeral equivalent is: IX Name the program: RecRomanCovertXX.cpp, where XX are your initials.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
QUIZ... Let D be a poset and let f : D D be a monotone function. (i) Give the definition of the least pre-fixed point, fix (f), of f. Show that fix (f) is a fixed point of f. [5 marks] (ii) Show that...
-
A- Farah Corporation has provided the following production and total cost data for two levels of monthly production volume. The company produces a single product which it sells at $132.7 per unit...
-
The following transactions were completed by Montague Inc., whose fiscal year is the calendar year: 2016 July 1. Issued $55,000,000 of 10-year, 9% callable bonds dated July 1, 2016, at a market...
-
Determine whether you would take a census or use a sampling. If you would use a sampling, determine which sampling technique you would use. Explain. (a) The most popular type of investment among...
-
Briefly explain how the following programs would affect the elasticity of demand for labor in the steel industry: a. An increased tariff on steel imports. b. A law making it illegal to lay off...
-
As the production planner for Scott Sampson Products, Inc., you have been given a bill of material for a bracket that is made up of a base, two springs, and four clamps. The base is assembled from...
-
What will be the output of the following code snippet? (5 Puan) interface MyInterface3 { } public void myMethod (); abstract class MyAbstractClass3 { }) public abstract void myMethod (); class...
-
http://hotseat.mhhe.com/mm.html For this assignment, you will need to complete the Privacy: Burned by the Firewall portion of The Manager's Hot Seat. Please be sure to follow these steps to ensure...
-
9. A 36.0 kg box is being pulled by a person across a horizontal floor with a force F = 155 N that makes an angle 8 = 26.0 with the horizontal as shown in the figure. What is the magnitude of the...
-
The block in the figure below has a mass of 5.9 kg and it rests on an incline of angle 0. You then push on the block with a force of F=37 N, directed up the slope as shown. Assume the incline is...
-
A. If you approach this intersection while driving, do you or the pedestrian have the right of way? B. Explain why.
-
A. Describe at least two risky driving behaviors you observe in this picture. B. Choose one vehicle and explain what you would do differently.
-
A block of mass m = 2.40 kg is in equilibrium on an incline plane of angle = 27.0 when connected as shown in the diagram below. Spring Scale m 07 Assume the mass of the strings to be negligible. If...
-
Find the radian measure to three decimal places for the angle. Round all intermediate calculations to three decimal places if necessary. 14026'13" radians Your Answer: References Hints
-
Solve each equation. x 3 - 6x 2 = -8x
-
A Person has a name (just a first name for simplicity) and friends. Store the names of the friends in a string, separated by spaces. Provide a constructor that constructs a person with a given name...
-
This chapter contains a number of recommendations regarding variables and constants that make programs easier to read and maintain. Briefly summarize these recommendations.
-
Write a method public static boolean sameSet(int[] a, int[] b) that checks whether two arrays have the same elements in some order, ignoring duplicates. For example, the two arrays 1 4 9 16 9 7 4 9...
-
Galinha-Esquina SA grows and processes chickens. Each chicken is disassembled into five main parts. Information pertaining to production in July 2022 is as follows: Joint costs of production in July...
-
What is a joint cost?
-
Terms a Split-off point b Joint cost c Separable cost d By-product e Joint product f Product Definitions 1 Product with low sales value compared with the sales value of the main or joint product(s)....
Study smarter with the SolutionInn App