How to resolve the algorithm Roman numerals/Decode step by step in the TUSCRIPT programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Roman numerals/Decode step by step in the TUSCRIPT programming language

Table of Contents

Problem Statement

Create a function that takes a Roman numeral as its argument and returns its value as a numeric decimal integer. You don't need to validate the form of the Roman numeral. Modern Roman numerals are written by expressing each decimal digit of the number to be encoded separately, starting with the leftmost decimal digit and skipping any 0s   (zeroes). 1990 is rendered as   MCMXC     (1000 = M,   900 = CM,   90 = XC)     and 2008 is rendered as   MMVIII       (2000 = MM,   8 = VIII). The Roman numeral for 1666,   MDCLXVI,   uses each letter in descending order.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Roman numerals/Decode step by step in the TUSCRIPT programming language

Source code in the tuscript programming language

$$ MODE TUSCRIPT
LOOP roman_number="MCMXC'MMVIII'MDCLXVI"
arab_number=DECODE (roman_number,ROMAN)
PRINT "Roman number ",roman_number," equals ", arab_number
ENDLOOP

  

You may also check:How to resolve the algorithm Copy a string step by step in the zkl programming language
You may also check:How to resolve the algorithm Pell numbers step by step in the Haskell programming language
You may also check:How to resolve the algorithm Regular expressions step by step in the Rust programming language
You may also check:How to resolve the algorithm Damm algorithm step by step in the CLU programming language
You may also check:How to resolve the algorithm Catamorphism step by step in the Oforth programming language