how do u find the percantage composition of an element?

You have a large fruit pie that has 2 lb apples, 3 lbs oranges and 4 lbs lemons in it and nothing else. It may not be a very good pie but let's pretend anyway.

% apples = (mass apples/total mass)*100 = (2/9)*100 = ?
% oranges = (3/9)*100 = ?
% lemons = (4/9)*100 = ?

Same thing with molecules. Let's say we have CaF2.
molar mass CaF2 =
Ca = 40
F = 19 and 2*19 = 38
Total = 40+38 = 78.
%Ca = (40/78)*100 =
%F = (2*19/78)*100 = (38/78)*100 = ?