To calculate the useful energy generated by the machine, you can use the formula for efficiency:
\[ \text{Efficiency} (%) = \left(\frac{\text{Useful Energy Output}}{\text{Energy Input}}\right) \times 100 \]
In this case, the efficiency is 15% and the energy input is 300 joules. Rearranging the formula to find the useful energy output:
\[ \text{Useful Energy Output} = \text{Efficiency} \times \frac{\text{Energy Input}}{100} \]
Substituting the values:
\[ \text{Useful Energy Output} = 15 \times \frac{300}{100} = 15 \times 3 = 45 \text{ joules} \]
So, the useful energy generated is 45 joules.