# Read in a roman numeral n and convert it to a decimal number. (M = 1000, D = 500, C = 100, L = 50, X = 10, V = 5 and I = 1)

**INSTRUCTIONS TO CANDIDATES**
###### ANSWER ALL QUESTIONS

04 Roman to decimal

Read in a roman numeral n and convert it to a decimal number. (M = 1000, D = 500, C = 100, L = 50, X = 10, V = 5 and I = 1)

Example: n = DXII --> 500 + 10 + 1 + 1 = 512

(tip: work with the length of a word and ElementAt())

Input/Output

input:

DXII

output:

512

input:

MDCCXXXIIII

output:

1734

04 Floyd's triangle

Read in a number a lines and print out the triangle of Floyd! https://en.wikipedia.org/wiki/Floyd%27s_triangle Links to an external site.

Input/Output

input:

5

output:

1

2 3

4 5 6

7 8 9 10

11 12 13 14 15

input:

2

output:

1

2 3

04 Factorial

Read in a nonnegative integer n (if not, print out 'crazy input') and calculate its factorial n!. The factorial formula is given by n! = 1 * 2 * 3 * ... *n

Some examples:

0! = 1

1! = 1

2! = 1 * 2 = 2

3! = 1 * 2 * 3 = 6 ...

Input/Output

input:

7

output:

5040

input:

1

output:

1

##### Attachments:

## Related Questions

##### . Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

##### . The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

##### . Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

##### . SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1
Project 1
Introduction - the SeaPort Project series
For this set of projects for the course, we wish to simulate some of the aspects of a number of

##### . Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1
Project 2
Introduction - the SeaPort Project series
For this set of projects for the course, we wish to simulate some of the aspects of a number of