Question
Using Java Create a method called findLocation that takes a 2D array and a string called name . The 2D array has two columns to
Using Java
Create a method called findLocation that takes a 2D array and a string called name. The 2D array has two columns to store the character and location information. This method should search the first column of the array (i.e., character) for the name argument.
If name appears in the 2D array, return the corresponding location.
If name does not appear in the 2D array, return Sorry! The character you are looking for is not in the park today!
For example, findLocation(characterLocations, Belle) should return Fantasyland.
The signature of the method findLocation is:
public static String findLocation(String[][] storedValue, String name)
Create a 1D array of string, called menuItems, to store the names of the menu items. B. Create a 1D array of integer, called menuPrices, to store the prices of the menu items. C. Read the menuItems.txt file and add the menu items into the menuItems array. D. Read the menuPrices.txt file and add the menu prices into the menuPrices array. This array should be of type int. E. Print the menuItems and menuPrices arrays as follows: Item 1. Churro - $5 Item 2. Ice Cream - $4
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