Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Bartleby Related Questions Icon
Related questions
Question
In Java please,
Transcribed Image Text:the output of the program is:
Ham sandwich (Sandwiches)
Classic ham sandwich
--
Caesar salad (Salads)
Chunks of romaine heart lettuce dressed with lemon juice
--
Water (Drinks)
16oz bottled water
Beef tacos (Mexican food)
Ground beef in freshly made tortillas
--
373632.2429182.qx3zqy7
LAB
9.9.1: LAB: Parsing food data
ACTIVITY
Downloadable files
food.txt
Download
LabProgram.java
1 import java.util.Scanner;
2 import java.io.FileInputStream;
3 import java.io.I0Exception;
4
5 public class LabProgram {
public static void main(String[] args) throws IOException {
Scanner scnr = new Scanner(System.in);
6
7
8
9
/* Type your code here. */
Transcribed Image Text:9.9 LAB: Parsing food data
Given a text file containing the availability of food items, write a program that reads the information from the text file and outputs the
available food items. The program first reads the name of the text file from the user. The program then reads the text file, stores the
information into four separate arrays, and outputs the available food items in the following format: name (category) -- description
Assume the text file contains the category, name, description, and availability of at least one food item, separated by a tab character.
Ex: If the input of the program is:
food.txt
and the contents of food.txt are:
Sandwiches
Ham sandwich
Classic ham sandwich
Available
Sandwiches
Chicken salad sandwich
Chicken salad sandwich
Not available
Sandwiches
Cheeseburger
Classic cheeseburger
Not available
Salads
Caesar salad
Chunks of romaine heart lettuce dressed with lemon juice
Available
Salads
Asian salad Mixed greens with ginger dressing, sprinkled with sesame
Not available
Drinks
Water
16oz bottled water
Available
Drinks
Соса-Сola
16oz Coca-Cola
Not available
Mexican food
Chicken tacos
Grilled chicken breast in freshly made tortillas
Not available
Mexican food
Beef tacos
Ground beef in freshly made tortillas
Available
Vegetarian
Avocado sandwich
Sliced avocado with fruity spread
Not available
the output of the program is:
Expert Solution
Check MarkThis question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
bartleby
This is a popular solution
bartleby
Trending nowThis is a popular solution!
bartleby
Step by stepSolved in 2 steps with 1 images
Knowledge Booster
Background pattern image
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Some languages support many modes of parameter passing. Provide 2 examples using two different programming languages which support the user of the programming language deciding which to use when creating their method. (Programming Languages)arrow_forwardWhy Runnable Interface is used in Java?arrow_forwardEmployee Paycheck in C++ Programming:arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education