Tests: In the test_sun.py module, create tests for the planet objects. You can (and should) do this before you have written any Planet code at all. Implementation: In the sun.py module (see template), implement a Sun class as described in Section 10.4. Your Sun class should include the following methods: __init__, get_mass, get_radius, get_temperature, and __str__. Your __str__ method should include the following information for each planet: Name, distance from sun, radius, and mass.
Tests: In the test_sun.py module, create tests for the planet objects. You can (and should) do this before you have written any Planet code at all. Implementation: In the sun.py module (see template), implement a Sun class as described in Section 10.4. Your Sun class should include the following methods: __init__, get_mass, get_radius, get_temperature, and __str__. Your __str__ method should include the following information for each planet: Name, distance from sun, radius, and mass.
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 10PE
Related questions
Question
Tests: In the test_sun.py module, create tests for the planet objects. You can (and should) do this before you have written any Planet code at all.
Implementation: In the sun.py module (see template), implement a Sun class as described in Section 10.4. Your Sun class should include the following methods: __init__, get_mass, get_radius, get_temperature, and __str__. Your __str__ method should include the following information for each planet: Name, distance from sun, radius, and mass.
section 10.4
![class Solar System:
def _init_(self, aSun):
self._theSun = aSun
self._planets = []
def addPlanet(self,aPlanet):
self._planets.append (aPlanet)
def showPlanets (self):
for aPlanet in self._planets:
print(aPlanet)](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F734f4932-9c15-4e07-80c9-d54d94f3ad88%2Ff44c24b2-9e94-4e0c-a080-50123371f790%2Folv6v59_processed.png&w=3840&q=75)
Transcribed Image Text:class Solar System:
def _init_(self, aSun):
self._theSun = aSun
self._planets = []
def addPlanet(self,aPlanet):
self._planets.append (aPlanet)
def showPlanets (self):
for aPlanet in self._planets:
print(aPlanet)
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,