Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Java Gerbil Problem This section defines a game with a pet gerbil that descends into crevices to acquire precious metal nuggets. Since gerbils are

Use Java
image text in transcribed
image text in transcribed
Gerbil Problem This section defines a game with a pet gerbil that descends into crevices to acquire precious metal nuggets. Since gerbils are small, you gerbil can only carry 10 ounces. Rhodium is the most valuable metal, Platinum is the second most valuable metal, Gold is the third most valuable metal, and Ruthenium is the least valuable metal. You want to train your gerbil such that whern sent into a crevice, the gerbil returns with the most valuable haul. For example, if the crevice contains 5 ounces of Rhodium, 6 of Platinum, 4 of Gold, and 7 of Ruthenium, I want her to return with 5 ounces of Rhodium and 5 of Platinum. Create a Java class Gerbil that has a found method with the following signature. public static void found (int rhodium, int platinum, int gold, int ruthenium) The formal parameters are the amounts of Rhodium, Platinum, Gold, and Ruthenium in the crevice. The method found prints to the console the best retrieval of metal for that trip into the crevice. The following are example calls to the method found

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

Web Database Development Step By Step

Authors: Jim Buyens

1st Edition

0735609667, 978-0735609662

More Books

Students also viewed these Databases questions

Question

8. Do the organizations fringe benefits reflect diversity?

Answered: 1 week ago

Question

7. Do the organizations social activities reflect diversity?

Answered: 1 week ago