Rule Based System
1. Given the rule following rules from the class notes onproduction rules to convert an Arabic number less than 40 to aroman numeral. USING LOGIC
Rule 1: if x is null then prompt the user and read x
Rule 2: if x is higher than 999 then print “too Big†and make xnull
Rule 3: if x is between 10 and 39 then print “X†and reduce x by10
Rule 4: if x is equal to 9 then print “IX†and reduce x to 0
Rule 5: if x is between 5 and 8 then print “V†and reduce x by5
Rule 6: if x is equal to 4 then print “IV†and reduce x to 0
Rule 7: if x is between 1 and 3 then print “I†and reduce x by1
Rule 8: if x is equal to 0 then print “end-of-line†and STOP
A. What additional rules are needed to convert an Arabic numberless than 1000?
* notice rule 2 has already been changed
** hints: 50 is L; 100 is C; 500 is D; 1000 is M
B. Show the rules fired and the working memory to convert 864into a roman numeral.