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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!