Answer:
Oatmeal cookies = 1 dozen
Sugar cookies = 7 dozen
Explanation:
Objective function:
Maximize:        P = 3x + 2y
where
                        x =  oatmeal cookies
                        y = sugar cookies
Constraints:
Since it takes 2 and 4 cups for oatmeal and sugar cookies respectively, and she has total 40 cups of sugar:
1)      3x+4y ≤ 40
The same for eggs:
2)     2x+y ≤ 20
She can make no more than 1 dozen oatmeal and 7 dozen sugar cookies:
3)      x ≤ 1
4)      y ≤ 7
Now graph these above four constraints equation( see the image below)
Now the corner points are :
(0,7), (1,7), (1,0), (0,0)
Put these corner points in objective function:
for (0,7) :  P = ( 3×0 )  + ( 2×7 ) = 14
for (1,7) :   P = ( 3×1 )  + ( 2×7 ) = 17
for (1,0) :   P = ( 3×1 )  + ( 2×0 ) = 3
for (0,0) :  P = ( 3×0 )  + ( 2×0 ) = 0
Since the maximum profit = 17 comes from the point (1,7), she should make 1 dozen of oatmeal cookies and 7 dozen of sugar cookies.