Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Its about using arrays and I\'m having a trouble time with this, please help. Th

ID: 3625858 • Letter: I

Question

Its about using arrays and I'm having a trouble time with this, please help. This is the first of 4 but this one will give me an idea of the others.

Write a program that displays the Roman numeral equivalent of a decimal number between 1 and 20 that the user enters. The Roman numerals should be stored in an array of strings initialized with the appropriate Roman numerals and the decimal number that the user enters should be used to locate the array element containing the Roman numeral equivalent. The program should have a loop that allows the user to continue entering numbers until an end sentinel of zero is entered.

Input validation: Do not accept values less than 0 or greater than 20.
Declare appropriate data types with descriptive names.

Approach:

Identify [1] the input(s), [2] the processing and [3] the output and write pseudocode for this program. Check each step in the pseudo code to make sure they are complete and that the relationships (order) of the steps are correct.

Explanation / Answer

please rate - thanks

everyone does pseudocode differently, this should help

{roman[0]="I"

roman[1]="II"
roman[2]="III"
roman[3]="IV"
roman[4]="V"
roman[5]="VI"
roman[6]="VII"
roman[7]="VIII"
roman[8]="IX"
roman[9]="X"
roman[10]="XI"
roman[11]="XII"
roman[12]="XIII"
roman[13]="XIV"
roman[14]="XV"
roman[15]="XVI"
roman[16]="XVII"
roman[17]="XIII"
roman[18]="XIX"
roman[19]="XX"
prompt user for number
enter the number n
loop:

n<0 or n>20)
         yes: give error message
                 prompt for new number
                 get new number
                 go to loop

n = 0
     yes:
           exit program
     no:
        output n and roman[n-1]
        prompt for new number
        get new number
        go to loop

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote