Answered step by step
Verified Expert Solution
Question
1 Approved Answer
6 . 1 8 LAB: Parsing food data Given a text file containing the availability o f food items, write a program that reads the
LAB: Parsing food data
Given a text file containing the availability 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 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 the following format: name description
Assume the text file contains the category, name, description, and availability least one food item, separated a tab character.
: the input the program :
food.
and the contents food. tot are:
the output the program :
food file
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 romaine heart lettuce dressed with lemon juice Available
Salads Asian salad Mixed greens with ginger dressing, sprinkled with sesame Not available
Drinks Water bottled water Available
Drinks CocaCola CocaCola Not available
Mexican food Chicken tacos Grilled chicken breast freshly made tortillas Not available
Mexican food Beef tacos Ground beef freshly made tortillas Available
Vegetarian Avocado sandwich Sliced avocado with fruity spread Not available
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