It is correct, next time re-check your answer and don't second guess yourself. ;3
a) Group 2 elements have 2 electrons on their outer shell, so they form a 2+ charge.
b) they lose 2 electrons as they are transferred to the non metal.
c)They obtain this charge as when they are made into an ionic compound the 2 electrons on the outer shell are transferred to the non metal, meaning there are 2 more protons that electrons, giving it a positive charge.
hope this helps! :)
Because more than one substance was released (following a color change signifying a chemical reaction), the sample was indeed, a compound.