Question
Using Java coding language, Declare and create a 2-D Array called characterLocations . Initialize the array with all the characters characterLocation[][] = {Mickey Mouse,Main Street
Using Java coding language,
Declare and create a 2-D Array called characterLocations. Initialize the array with all the characters
characterLocation[][] = {"Mickey Mouse","Main Street USA"},{"Minnie Mouse", "Toon Town"},{"Goofy","Frontier Land"},{"Pluto","Tomorrowland"},{"Belle","Fantasyland"},{"Jasmine", "Adventureland"}
For example, Mickey Mouse and Main Street USA will appear in the same row but different columns within the array.
2. 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)
Disneyland Resort has a set list of menu items and prices. The list of items that you are most interested in has been saved in two separate files: menuItems.txt and menuPrices.txt.
The first file (menuItems.txt) contains a set of food items, one item per line.
The second file (menuPrice.txt) contains corresponding price for the food in the previous file. Assume you can have a maximum of 12 items.
A. 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
Based on the information gathered above, you will now set up a system to search for the location of Disney characters and take a food order.
A. Ask the user if s/he would like to know where a Disney character is located. If the user responds with a Y, ask for the name of the character and use findLocation to find the park location of the character. You should use the characterLocations array. If the user responds with a N, move to option B.
B. Request the user to let you know if they would like to view the menu. The user should reply either a Y or N. If answer is Y, proceed to step C. If answer is N, your program should exit, unless you do the bonus in Part IV.
C. Display the following list to the user a. Enter 1 for Churro
b. Enter 2 for Ice Cream
c.
D. Ask the user if they would like to order anything from the menu. They should reply either Y or N. If Y, prompt the user to insert item number. If N, move to step H.
E. Based on the menu item number the user selects, print a message displaying the name and price of the item.
F. Keep track of the total price of the order.
G. After taking each order, go to step D.
H. When the user is done ordering, the program should ask if the user has an annual pass. Annual pass holders will receive a 15% discount on the entire order. a. If they are annual pass holders, they should be given a discount, otherwise they will pay full price
I. Display the total amount due (without tax).
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