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
DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma
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. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
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
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