Building Rome in a Day

Objective

 

Make sure that students understand the basics of C# from ITFN1303 such as function calls, parameter passing, conditionals, iteration, input and output streams, the preprocessor, and the Microsoft Visual .NET C# IDE.

 

This program should be relatively easy for you if you know the prerequisite information from Intro to C#.  If this project is difficult for you, make sure you’re up to speed on the ITFN1303 topics.

Estimated Time to Completion: < 4 hours

Task

 

Write a program in Microsoft Visual C# that prompts the user for a non-negative integer over and over, each time printing out the Roman numeral equivalent, until the user enters the value zero (0). 

 

Some important Roman numerals you might be interested in (see the pattern?):

1          I

2          II

3          III

            4          IV

5                     V

9                     IX

10                 X

40         XL

49                 XLIX

50                 L

90                 XC

99                 XCIX

100              C

400              CD

500              D

999              CMXCIX

1000          M

3999     MMMCMXCIX

You can do this as a text-based program (console) or a Windows-based program (using text boxes, labels, and buttons).

 

You must do the following:

 

 

50%      Write the main algorithm that loops, asking the user for an integer between 0 and 3999 until the user enters zero (0).  You must do range checking, so that if the user enters an invalid number (a negative or >= 4000), an error message is printed (but the loop continues).

 

75%      Write a function that takes in an integer (1-3999) via a by-value parameter and prints out the Roman numeral equivalent.  Return 0 upon successful completion of the function.

 

100%    Call the function you wrote for part 2 (above) from the main algorithm for each valid integer (1-3999) entered by the user.

Deliverable

 

Entire C# project/solution folder, zipped - which compiles and works as defined above.

 

Any project that doesn’t compile or terminates “ugly” will receive no credit.