(a) Autotrophs prepare their food (carbohydrate) in presence of sunlight with the help of carbon dioxide and water. This process is called photosynthesis.
(b) According to 10% law, 10 % to 500J that is 50J is transferred to sheep (I consumer). Hence, 5J of energy is transferred to lion (II consumer) that is 10 % of 50 J.