Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
