181k views
2 votes
The maximum weight the box can possibly hold is 49 ounces. The scale at the checkout counter will weigh the box and calculate the price based on the weight. You want to write a Prolog program (rule) itemsByWeight(P, S, C, F, W) to find how many items of each kind are in the box according to the total weight W, where P, S, C and F are the numbers of Pizza slices, Salad bowls, Cupcakes, and Fries packs, respectively.

User Dotism
by
4.5k points

1 Answer

0 votes

Answer:

A practical example is this definition of the square of a number, intended to be a function predicate: square(X,Y) :- Y is X * X.

Step-by-step explanation:

User Crazypeter
by
5.5k points