Step 1: Use Newton’s Law of Gravitation.
The gravitational force between two objects is given by:
\[
F = \frac{G \cdot M_{\text{sun}} \cdot m_{\text{earth}}}{r^2},
\]
where \(F\) is the force, \(G\) is the gravitational constant, \(M_{\text{sun}}\) is the mass of the sun, \(m_{\text{earth}}\) is the mass of the earth, and \(r\) is the radius of the earth's orbit. Using the centripetal force formula for an orbiting body:
\[
F = m_{\text{earth}} \cdot v^2 / r,
\]
where \(v\) is the orbital velocity of the earth. Equating the two expressions for \(F\) and solving for \(M_{\text{sun}}\):
\[
\frac{G \cdot M_{\text{sun}} \cdot m_{\text{earth}}}{r^2} = m_{\text{earth}} \cdot v^2 / r,
\]
\[
M_{\text{sun}} = \frac{v^2 \cdot r}{G}.
\]
Step 2: Calculate the mass of the sun.
Substituting the given values:
\[
M_{\text{sun}} = \frac{(30 \times 10^3)^2 \cdot (150 \times 10^6 \times 10^3)}{6.7 \times 10^{-11}} = 1.99 \times 10^{30} \, \text{kg}.
\]
Step 3: Conclusion.
The mass of the sun is 1.99 \(\times\) 10\(^30\) kg.