October 2019
Beginner to intermediate
498 pages
14h 13m
English
Sun ClassOur task in this chapter is to construct a software model of a planetary system. To do so, we need to consider not just the planets that might be present, but the most important member of the system—the sun. We will consider the sun to be similar to a planet, in that it is a large, round, celestial body. It will certainly have some of the same characteristics as planets, including a name, mass, and radius. However, because the sun is at the center of the solar system, it will not have any distance measure. In addition, the sun provides heat and light that can be characterized by the temperature on the surface.
Given that description, we can create a Sun class using the same pattern that we followed ...
Read now
Unlock full access