With 9 large eggs, they already weigh 18 ounces, so I’m not sure what the question means.
The equation should be 1.75x + 2y = 18.
If the question means how many combinations of eggs to make 18 ounces, then only 7 large eggs and 8 medium eggs or 9 large eggs satisfy the equation.
x = 8, y = 7 or x = 0, y = 9.