Final answer:
The units for the semimajor axis (D) should be astronomical units (AU), and the units for the period (P) should be years when using the equation to calculate the mass of a star.
Step-by-step explanation:
When calculating the mass of a star based on the motion of a planet, and given Newton's gravitational constant G with units of m3 kg-1 s-2, the units for semimajor axis (D) should be astronomical units (AU), and the units for the period (P) should be years. Therefore, when using the relationship D3 = (M1 + M2)P2 to calculate the sum of the masses of two stars in a binary system, we measure D in AU, P in years, and the mass sum (M1 + M2) in units of the Sun's mass.