Please write in Java

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Please write in Java

Post by answerhappygod »

Please write in Java
Please Write In Java 1
Please Write In Java 1 (94.66 KiB) Viewed 45 times
15.4 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: Classic ham sandwich Available Sandwiches Sandwiches Ham sandwich 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 Mexican food. Mexican food Vegetarian Coca-Cola 16oz Coca-Cola Not available Chicken tacos Grilled chicken breast in freshly made tortillas Not available Beef tacos Ground beef in freshly made tortillas Available Avocado sandwich sliced avocado with fruity spread Not available 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply