Answered step by step
Verified Expert Solution
Question
1 Approved Answer
the starter code is here and the code goes below the getallchoices method Suppose you are at the ice cream store trying to decide what
the starter code is here and the code goes below the getallchoices method Suppose you are at the ice cream store trying to decide what combination of flovers ond toppings you want on your ice cream, but there's simply too many combinations to processl To aide you in this decision, you decide to write a program thatll print out every possble chaice for you Copy the code from IceCreamProctice.txt onte IDoodle. Inside is the following method: string[1[] getAl1choloes ( stringll flavoks, stringt) toppinge ) The main method is already completed for you. Only write code inside the get AllChoices method. The first parameter is an orray of Strings storing all possible flavors. The second parameter is an emay of Strings storing all possible toppings. The method will return a 20 -array (natrix) of Strings containing every possible combination of flovors and toppings. Each combination must be written using the following formati "(flavor) with (tepping) on top." Example: "Chocolate with Cherry on top." The following code: string[] flavors = (mocha", "vani11a"): string[] toppings = ("sprinkles", "fudge", "cherry): hing[] [1 combos = getal1choicest sprinkles, toppings in import java.ut:il.Arrays? public class Myclass \{ public static string[][] getAluchoices( String[] flavors, string[] toppings) [ i) public static void main( string[] args ) [ string[][] combos = getAl1Choices( flavors, toppings ): printMatrix( conbos ); ) public static void printhatrix( String[][] natrix) \& for ( int i=8;1 = Arrays.tostring( eatrix[1] ) )
the starter code is here and the code goes below the getallchoices method
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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