Question: Write a prolog program called ntoe, which is a predicate of arity 2: ntoe(Integer, List). This predicate will convert an integer number into its text
Write a prolog program called ntoe, which is a predicate of arity 2: ntoe(Integer, List). This predicate will convert an integer number into its text version. For example: ?-ntoe(12345, X) X = [one, two, three, four, five]. ?-ntoe(12, [one, two]). yes. ?-ntoe(-123, N). N = [negative, one, two, three]. Provide another predicate called eton, which is a predicate of arity 2: eton(Integer, List). This predicate will transofmr a list of text into an integer number. For example: ?- eton(X, [one, two, three]). X = 123.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
