Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Coding language : NODE JS (JavaScript) Programming challenge to convert cardinal number to roman numerical Many people are familiar with the roman numerals for relatively

Coding language : NODE JS (JavaScript)

Programming challenge to convert cardinal number to roman numerical

Many people are familiar with the roman numerals for relatively small numbers, The symbols I (capital i), V, X, L, C, D, and M represent the decimal value 1, 5, 10, 50, 100, 500 and 1000 respectively. To represent other values, these symbols and multiple where necessary, are concatenated, with the smaller- valued symbols written further to the right. For examples, the number 3 is represented as III and the value 73 kis represented as LXXIII. The exceptions to this rules occur for numbers having untils values of 4 or 9, and for tens values of 40 or 90 for these case, the roman numeral representation are IV (4) IX (9), XL(40), and XC(90). So the Roman numeral representations for 24, 39, 44, 49, and 94 are XXIV, XXXIX, XLIV, XLIX and XCIV, respectively.

Write a program to convert a cardinal number to a Roman numeral,

Input

Your program should read lines from the standard input. Each line contains a cardinal number N(1 <= N <= 3999)

Output

Print out the value of N in Roman numeral

Code given:

process.stdin.resume();

process.stdin.setEncoding('utf8');

var stdin = ' ';

process.stdin.on('data', function (chunk) {

stdin += chunk;

}).on('end', function() {

var lines = stdin.trim().split(' ');

for(var i=0; i

process.stdout.write(lines[i]);

}

});

please all your work with screen for the output.

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

Database Systems For Advanced Applications 17th International Conference Dasfaa 2012 Busan South Korea April 2012 Proceedings Part 1 Lncs 7238

Authors: Sang-goo Lee ,Zhiyong Peng ,Xiaofang Zhou ,Yang-Sae Moon ,Rainer Unland ,Jaesoo Yoo

2012 Edition

364229037X, 978-3642290374

More Books

Students also viewed these Databases questions

Question

Evaluate the expression. 5 C 3

Answered: 1 week ago

Question

(1 point) Calculate 3 sin x cos x dx.

Answered: 1 week ago

Question

Find the derivative of y= cos cos (x + 2x)

Answered: 1 week ago