Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given an integer n (input from the user), write a C++ program which determines the equivalent of n in the roman numeral system. The user

Given an integer n (input from the user), write a C++ program which determines the equivalent of n in the roman numeral system. The user will provide a value of n greater than 0 and less than 4000.

The symbols are :

image text in transcribed

Only the symbols I,X, C and M can be repeated, up to 3 times. For instance, 15 cannot be represented by VVV (symbol V cannot be repeated); 15 must be represented as XV.

To get full mark, your solution must use

1 or 2 loops at most

1, 2, 3 or 4 switch instructions at most, and each switch can have up to 5 cases, including the default case

less than 11 if statements (ie. up to 10 if statements are allowed)

- to output the result : output only the number in the roman numeral system.

Example of what is displayed in the console:

Enter n 4

IV

+ 62% . 1 1 :42 https://culearn.carleton.ca/mooc lag question Given an integer n (input from the user), write a C++ program which determines the equivalent of n in the roman numeral system. The user will provide a value of n greater than 0 and less than 4000 The symbols are 4 Ix XL 40 50 90 100 400 500 900 1000 XC CD CM Only the symbols I,X, C and M can be repeated, up to 3 times. For instance, 15 cannot be represented by VVV (symbol V cannot be repeated); 15 must be represented as XV

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle9i Database Administrator Implementation And Administration

Authors: Carol McCullough-Dieter

1st Edition

0619159006, 978-0619159009

More Books

Students also viewed these Databases questions

Question

What are the four perspectives of the balanced scorecard?

Answered: 1 week ago