
Enumeration Types
The purpose of this exercise is to give you practice working with
enumeration types. You are to write a program that does the following:
1. The input to this program is roman numerals (values I thru XV).
2. The output of this program is words that represent numbers
(values one thru fifteen).
3. The program will prompt the user for a roman numeral:
Please enter a roman numeral (I thru XV) >
4. Given that the input value is three, the program output is:
The number entered in word form is THREE
Parts of the program named lab_04 are given below (see Section 4.4 of your textbook).
WITH Ada.Text_IO;
PROCEDURE lab_04 IS
TYPE Roman IS ( I, II, III, IV, V, VI, VII, VIII, IX, X,
XI, XII, XIII, XIV, XV);
PACKAGE Roman_IO IS NEW Ada.Text_IO.Enumeration_IO (Enum => Roman);
TYPE Num_Words IS .......
nat : Natural;
rom : Roman;
word : Num_Words;
BEGIN
..... -- The "....." should be replaced by your code.
.....
.....
END lab_04;