Let, amount of fat is 3x .
So, amount of protein is 5x .
It is given that sum of fat and protein is 24 grams.
3x + 5x = 24
8x = 24
x = 3 grams
Amount of fat is, F = 3×3 = 9 grams .
Amount of protein is, P = 5×3 = 15 grams.
Calories in fat, F = 9×9 = 81 calories .
Calories in protein, P = 15×4 = 90 calories .
Therefore, calories from fat and protein is 81 and 90 respectively.
Hence, this is the required solution.