Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING JAVA. For part 2 instead of of reading the txt file can you help me put it into arrays. Part 3 i need help

USING JAVA. For part 2 instead of of reading the txt file can you help me put it into arrays. Part 3 i need help completing it too as well.

Here is my code. for Part 1

import java.util.Scanner;

public class ParkManager {

public static void main (String[] args) throws java.lang.Exception

{

String characterLocations[][] = {{"Mickey Mouse", "Main Street USA"}, {"Minnie Mouse", "Toon Town"}, {"Goofy", "Frontier Land"}, {"Pluto", "Tomorrowland"}, {"Belle","FantasyLand"}, {"Jasmine", "Adventureland"}};

for(int i=0;i

}

Scanner sc = new Scanner(System.in);

System.out.print("Enter the Character to find the location:");

String character = sc.nextLine();

findLocation(characterLocations, character);

}

public static void findLocation(String[][] characterLocations , String character){

for(int i=0;i

if(characterLocations[i][0].equalsIgnoreCase(character)){

System.out.println(characterLocations[i][1]);

return;

}

}

}

}

Here are the menuItems.txt and menuPrices.txt files in the table below.

menuItems.txt menuPrices.txt
Churros 5
Ice Cream 4
Hamburger 9
Cheeseburger 10
Turkey Leg 13
Corn Dog 7
Pizza 9
Funnel Cake 6
Soda 5

image text in transcribed

PartI Disneyland ResortC has a set list of menu items and prices. The list of items that you are most interested in has been set into two files (menultems.txt and menuPrices.txt). The first file contains a list of strings (menu items) separated by a comma. The second file contains a list of integers separated by a comma (item prices). Assume you can have a maximum of 12 items. A. Create one array of strings to hold the names of the menu items named menuitems[]. B. Create one array of integers to hold the prices of the menu items named menuPricesll C. Read the menuitems.txt file and add the menu items into the array menu!tems[]. D. Read the menuPrices.txt and add the menu prices into the array menuPricesl) E. Print the values of the menultems and menuPrices arrays as follows: Item 1. Churro - $5 Item 2. Ice Cream - $4 Part III Based on the information gathered in Part II. You will now set up a system to take a food order. A. Request the user to let you know if you could take their order. They should reply either "Y" or "N". If answer is "Y"proceed to B. If answer is "N" your program should exit, unless you do the bonus in Part IV Prompt the user for an order B. a. "Enter 1 for Churro" b. "Enter 2 for Ice Cream" c. "Enter 3 for Hamburger" C. You will print out a message saying what they just ordered and the price of that item D. Keep track of the total price of their order. E. After each order ask them if they would like to order another item. They should reply F. When they are done ordering food they should be asked if they are an annual pass holder a. If they are annual pass holders, they should be given a discount, otherwise they G. Tell the user the total amount due (do not worry about tax, nor receiving money. We will either "Y" or "N". (Annual pass holders will receive a 15% discount on the entire order) will pay full price assume that everyone will pay before they get to eat). Print a message that thanks them for their purchase and be sure to remind them to have a wonderful day

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions