Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started