Question: Problem 2B (50 points + 5 bonus) JAVA CODE Implement a program that inputs the diameter of a planet and the area covered by water,

Problem 2B (50 points + 5 bonus) JAVA CODE

Implement a program that inputs the diameter of a planet and the area covered by water, and determines whether the planet is suitable for human settlements; and, if not, whether it is suitable for a research station. Unlike a simpler version in Problem 2A, it should allow inputting information about multiple planets, print the results for each planet, and count the number of planets.

Input and output:

Your program should prompt the user to enter the diameter of the planet and the area covered by water. We assume that the diameter is a real value between 100.0 and 100,000.0 (measured in miles), and the area covered by water is a real value between 0.0 and 30,000,000,000.0 (measured in square miles). The program should then print one of these three statements: The planet is suitable for settlements, The planet is suitable for a research station, or The planet is not suitable for humans. After the program inputs the information about the first planet and outputs the related sentence, it should prompt the user to input information about the second planet, then about the third planet, and so on. When there are no more planets, the user inputs a negative number (e.g. ?1) as the planets diameter, which is the termination signal. Once the program gets a negative diameter, it should print the total number of planets and stop.

Problem 2B (50 points + 5 bonus) JAVA CODE Implement a program

Example: Command Prompt Enter diameter of the planet: 8000.0 Enter area covered by water: 100000000.0 The planet is suitable for settlements Enter dianeter of the planet: 1000 Enter area covered by water:0 The planet is suitale for a research station Enter diameter of the planet: 20000 Enter area covered by water: 100000000 The planet is not suitable for hunans Enter dianeter of the planet: 1 The Enterprise has discovered 3 new planets

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!