You are on page 1of 6

BCSE101E - Computer Programming:

Python

School of Computer Science and Engineering (SCOPE)


Vellore Institute of Technology
Vellore.
MODULE-1 (PROGRAM-3) 21BKT0077

10/1/2021

Write a PAC Chart, algorithm, and flowchart for converting the given two- digit
number into its corresponding Roman numeral.

Test Cases are:

Case 1 Case 2 Case 3

input = 20 input = 21 input = 25

output=XX output=XXI output=XXV

Problem Analysis Chart (PAC):

Data Processing Output Solution Alternatives

A two-digit 1.Defining a Roman None


number. dictionary and numeral of the
assigning key corresponding
values. two-digit
number
2.Using ‘for’ loop and
division
operators,get the
result.

October 1, 2021 Page 2


Flow Chart:

October 1, 2021 Page 2


Algorithm:

Step 1 : Start

Step 2 : Input an integer and store it in ‘a’.

Step 3 : Define a dictionary of 13 fundamental Roman numerals , i.e.,


1,4,5,9,10,40,50,90,100,400,500,900 and 1000 to their corresponding
Roman numerals.

Step 4 : Divide the input number with the integer equivalent of 13


Roman numerals in descending order.

Step 5 : If the division is feasible, i.e, quotient is not zero then it means
the roman numerical equivalent of the divisor constitutes the resultant
Roman number.

Step 6 : Output the Roman equivalent of the divisor as many as times


the quotient value.
October 1, 2021 Page 2
Step 7 : Update the input integer value to the remainder of the
division.

Step 8 : Repeat the above steps for all 13 fundamental Roman


numerals as the divisor (if the integer is not zero).

Step 9 : Stop

PROGRAM:

October 1, 2021 Page 2


OUTPUT:

October 1, 2021 Page 2

You might also like