From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c979c2bfcee9ee8d,start X-Google-Attributes: gid103376,public From: "Rea Burleson (CS)" Subject: try this if you can Date: 1996/06/05 Message-ID: #1/1 X-Deja-AN: 158686849 organization: University of South Florida x-sender: burleson@denning content-type: TEXT/PLAIN; charset=US-ASCII mime-version: 1.0 newsgroups: comp.lang.ada Date: 1996-06-05T00:00:00+00:00 List-Id: For all you ada dudes. I found this to be a very awarding program to try. My code was a little of 80 lines, can you beat it? The Roman numerals are indicated by the letters I, V, X, L, C, D and M, corresponding to 1, 5, 10, 50, 100, 500, 1000, respectively. In a Roman number, if the Roman numeral P stands immediately to the left of another Roman numeral Q and if P denotes a smaller number than Q, then the value of P is subtracted from the total number (eg. LIX means 59) otherwise P is added to the total number (eg. LXI means 61). For simplicity, it can be assumed that when a Roman number is input at least one space is left between the numerals. For instance the user can input M X M I V at the terminal. The program should then print out 1994. Write a program that first asks a user if s/he wishes to convert from an integer to a Roman number, or vice versa. The program should then ask the user for the input (either an integer or a Roman number) and produce the corresponding counterpart as output (a Roman number or an integer).Your program should be able to do some error checking - i.e. if the user enters an illegal Roman numeral, this should be indicated to the user. There should be no differentiation between lower and upper case. The program should ask the user if s/he wishes to continue conversions and should proceed to do so until indicated otherwise.