a grocer buys cases of almonds and walnuts. Almonds are packaged 20 bags per case . The grocer pays $30 per case of almonds and makes a profit of $17. Walnuts are packaged 24 bags per case. The grocer pays $26 per case of walnuts and makes a profit of $15 per case. He orders no more than 300 bags of almonds and walnuts together at a maximum of $400. What are the constraints. Write the objective function for number of cases and profit.

almonds being x and walnuts being y you put them in and there you go.

To determine the constraints for this problem, we need to consider the limits set by the grocer on the number of bags and the total cost.

1. Constraints for the number of bags:
- Let's denote the number of cases of almonds as 'A' and the number of cases of walnuts as 'W'.
- Each case of almonds contains 20 bags, so the number of almond bags will be 20A.
- Each case of walnuts contains 24 bags, so the number of walnut bags will be 24W.
- The total number of bags cannot exceed 300, so the constraint will be: 20A + 24W ≤ 300.

2. Constraint for the total cost:
- The grocer wants to spend no more than $400 on almonds and walnuts combined.
- The cost of each case of almonds is $30, and the grocer buys 'A' cases, so the cost of almonds will be 30A.
- The cost of each case of walnuts is $26, and the grocer buys 'W' cases, so the cost of walnuts will be 26W.
- The total cost cannot exceed $400, so the constraint will be: 30A + 26W ≤ 400.

Now, let's write the objective function.

Objective function for the number of cases:
Let X represent the total number of cases bought by the grocer.
The objective function for the number of cases would simply be:
X = A + W

Objective function for profit:
Let Profit represent the total profit made by the grocer.
The profit from each case of almonds is $17, and the grocer buys 'A' cases, so the profit from almonds will be 17A.
The profit from each case of walnuts is $15, and the grocer buys 'W' cases, so the profit from walnuts will be 15W.
The objective function for profit would be:
Profit = 17A + 15W

Therefore, the constraints are:
20A + 24W ≤ 300 (constraint for the number of bags)
30A + 26W ≤ 400 (constraint for the total cost)

And the objective functions are:
X = A + W (objective function for the number of cases)
Profit = 17A + 15W (objective function for profit)