<<

Classification

Our contains 8 primary planets and , which is a Dwarf . These 8 primary planets are: , , , , , , and . Out of these 8, the first 4 are Terrestrial planets while the other 4 are Jovian planets. Among the Jovian planets, Jupiter and Saturn are gas giants while Uranus and Neptune are ice giants. Some of these planets have satellites and . For example, Mars has 2 moons called and .

Write an algorithm using Python that: 1. Ask the user to manually input a planet in the solar system 2. Output {name} is a Terrestrial planet if the user chose Mercury, Venus, Earth or Mars 3. Output {name} is a Jovian planet if the user chose Jupiter, Saturn, Uranus or Neptune 4. Output {name} is a if the user chose Pluto 5. Output {name} is also a if the user chose either Jupiter or Saturn 6. Output {name} is also an if the user chose either Uranus or Neptune 7. If the user chose Mars, output “Mars has 2 moons, Phobos and Deimos” 8. If the user chose Jupiter, output “Jupiter has 4 satellites, 46 moons and 17 provisional moons” 9. If the user chose Saturn, output “Saturn has 7 satellites, 46 moons, 3 groups and 9 provisional moons” 10. If the user chose Uranus, output “Uranus has 5 satellites and 23 moons” 11. If the user chose Pluto, output “Pluto has 1 satellite and 4 moons” 12. Make sure that the name of the planet in the output section is always capitalized

An example of the output where the user has input ‘jupiter’ is:

Jupiter is a Jovian planet Jupiter is a gas giant Jupiter has 4 satellites, 46 moons and 17 provisional moons

Note that the user has input ‘jupiter’ but the output came out as ‘Jupiter’, which follows the rule given by #12.