Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JavaExercises.java has 4 different methods for you to complete: makeDice: This method takes returns a new array of integers [ 1 , 2 , 3
JavaExercises.java has different methods for you to complete:
makeDice: This method takes returns a new array of integers
takeOrder: This method takes a list String and returns a new array containing the orders of the customer. If the customer is Ergun, you should return an array of Strings beyti "pizza", "hamburger", "tea" in that order. If the customer is Erik, you should return an array of Strings sushi "pasta", "avocado", "coffee" In any other case, return an empty String array of size
NOTE: behaves strangely with Strings for reasons well see later in the course. You should check strings s and s for equality using sequalss in Java.
findMinMax: This method takes an int array and returns the the positive difference between the maximum element and minimum element of the given array. You may assume the input array is nonempty.
hailstone: This method takes an int n as input and returns its hailstone sequence as a list of integers. The hailstone sequence is defined by the following procedure: pick a positive integer n as the start. If n is even, divide n by If n is odd, multiply n by and add Continue this process until n is
You should compute this using recursion with the provided helper method hailstoneHelper.
For this part, you can import List and ArrayList.
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