Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Note : Please don t send the AI generated answer. AI generated answer doesn t help me at all. I need answer from the tutor.

Note : Please dont send the AI generated answer. AI generated answer doesnt help me at all. I need answer from the tutor. Thank you.
Topic name : Planet Enumeration
we have to work with some data on planets using an Enum class.we have
data on each planet, how many moons they have, and whether the planet is terrestrial or
Jovian. To put it simply, terrestrial planets are formed from rock and metal, while Jovian planets
are formed of gas and metal.
Planet # of Moons Type
Mercury 0 Terrestrial
Venus 0 Terrestrial
Earth 1 Terrestrial
Mars 2 Terrestrial
Jupiter 67 Jovian
Saturn 62 Jovian
Uranus 27 Jovian
Neptune 14 Jovian
1. We need to create an Enum class called Planet. Each planet has two fields: an integer
representing the number of moons, and a Boolean representing whether the planet is
terrestrial or Jovian. We have to Ensure that our class and Enum values follow naming standards.
2.Now we need to write any getters and setters our Enum class might need.
3. We have to create a class called PlanetInfo with a main method. When the main method
runs, print out each planet and how many moons they have.
4. We also have to modify the main method of PlanetInfo so that it prompts the user to enter in the name of a planet using a Scanner. The program will then print out whether that planet is
Jovian or terrestrial.
The sample run of the main method :
MERCURY has 0 moon(s).
VENUS has 0 moon(s).
EARTH has 1 moon(s).
MARS has 2 moon(s).
JUPITER has 67 moon(s).
SATURN has 62 moon(s).
URANUS has 27 moon(s).
NEPTUNE has 14 moon(s).
Enter a planet:
Neptune
NEPTUNE is Jovian

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions

Question

Explain the nature of human resource management.

Answered: 1 week ago

Question

Write a note on Quality circles.

Answered: 1 week ago

Question

Describe how to measure the quality of work life.

Answered: 1 week ago