Question: can some one solve this plzz Question 2: Searching for Artifacts (20 points) For this question, you will modify the above classes in order to

 can some one solve this plzz Question 2: Searching for Artifacts(20 points) For this question, you will modify the above classes in

can some one solve this plzz

Question 2: Searching for Artifacts (20 points) For this question, you will modify the above classes in order to add searching for alien artifacts. Make sure that your code works for the first question before you try this question Page 7 Note that you only hand in one set of files for this assignment (a) Planet Add two methods to the Planet class to handle searching for artifacts on a Planet A searchForArtifact method which returns true or false whether an artifact was found. First, a random number from 0 to 1 is generated. Return true if the random number is below the chance to find an artifact, otherwise false. The chance to find an artifact is an attribute of the Planet - For example, if the chance to find an artifact is 0, then it is impossible to generate a random number below this, and artifact searching will always fail - Use the Random class to generate the random numbers, and do not use a seed. A getDamageTaken method which returns the amount of damage taken by a spaceship when searching for an artifact (corrosive gases, running into terrain, etc.) - Generate a random number from 0 to 1, and multiply that number by the possible damage which is an attribute of the Planet. Return this value as a double - Use the Random class, and do not use a seed. - For example, the possible damage for searching Jupiter is from 0 to 400 Question 2: Searching for Artifacts (20 points) For this question, you will modify the above classes in order to add searching for alien artifacts. Make sure that your code works for the first question before you try this question Page 7 Note that you only hand in one set of files for this assignment (a) Planet Add two methods to the Planet class to handle searching for artifacts on a Planet A searchForArtifact method which returns true or false whether an artifact was found. First, a random number from 0 to 1 is generated. Return true if the random number is below the chance to find an artifact, otherwise false. The chance to find an artifact is an attribute of the Planet - For example, if the chance to find an artifact is 0, then it is impossible to generate a random number below this, and artifact searching will always fail - Use the Random class to generate the random numbers, and do not use a seed. A getDamageTaken method which returns the amount of damage taken by a spaceship when searching for an artifact (corrosive gases, running into terrain, etc.) - Generate a random number from 0 to 1, and multiply that number by the possible damage which is an attribute of the Planet. Return this value as a double - Use the Random class, and do not use a seed. - For example, the possible damage for searching Jupiter is from 0 to 400

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!