SlideShare a Scribd company logo
1 of 1
Download to read offline
28.1 LAB: Parsing food data Giveri a text file corsaining the swalability of tood items witse a
program that reads the information from the text file and outputs the avalable food inems. The
program first reads the name of the text file from the user. The program then reads the text fle,
stores the informatian into fou separate lists, and cutbus the avalable food iterns in the following
format name (categary) - description Assume the text file contains the category, name
description, and avalability of at least one food item, separated by a tab character (W). Ex if the
input of the program is: food.txt and the contents of food bxt are

More Related Content

More from info639484

25. It is hypothesized that Californian populations of Sea Otters a..pdf
 25. It is hypothesized that Californian populations of Sea Otters a..pdf 25. It is hypothesized that Californian populations of Sea Otters a..pdf
25. It is hypothesized that Californian populations of Sea Otters a..pdfinfo639484
 
24. Country A�s adult population is 100 million, and it is likely t.pdf
 24. Country A�s adult population is 100 million, and it is likely t.pdf 24. Country A�s adult population is 100 million, and it is likely t.pdf
24. Country A�s adult population is 100 million, and it is likely t.pdfinfo639484
 
2.4 Ethernet was originally developed to support a shared media envir.pdf
 2.4 Ethernet was originally developed to support a shared media envir.pdf 2.4 Ethernet was originally developed to support a shared media envir.pdf
2.4 Ethernet was originally developed to support a shared media envir.pdfinfo639484
 
2.6. (a) Find the frequency response H(ej) of the linear time-invaria.pdf
 2.6. (a) Find the frequency response H(ej) of the linear time-invaria.pdf 2.6. (a) Find the frequency response H(ej) of the linear time-invaria.pdf
2.6. (a) Find the frequency response H(ej) of the linear time-invaria.pdfinfo639484
 
2.Cases. Soulful Sounds Records inc. iby Ales Fither. aipecti ef t.pdf
 2.Cases. Soulful Sounds Records inc. iby Ales Fither. aipecti ef t.pdf 2.Cases. Soulful Sounds Records inc. iby Ales Fither. aipecti ef t.pdf
2.Cases. Soulful Sounds Records inc. iby Ales Fither. aipecti ef t.pdfinfo639484
 
20. If the process of completing business requirements is difficult i.pdf
 20. If the process of completing business requirements is difficult i.pdf 20. If the process of completing business requirements is difficult i.pdf
20. If the process of completing business requirements is difficult i.pdfinfo639484
 
2.2 A Network Topology is the arrangement with which computer systems.pdf
 2.2 A Network Topology is the arrangement with which computer systems.pdf 2.2 A Network Topology is the arrangement with which computer systems.pdf
2.2 A Network Topology is the arrangement with which computer systems.pdfinfo639484
 
2.3 Decapsulation is the inverse of the encapsulation process. Encaps.pdf
 2.3 Decapsulation is the inverse of the encapsulation process. Encaps.pdf 2.3 Decapsulation is the inverse of the encapsulation process. Encaps.pdf
2.3 Decapsulation is the inverse of the encapsulation process. Encaps.pdfinfo639484
 
2. What colour will methylene blue turn in the presence of carbon dio.pdf
 2. What colour will methylene blue turn in the presence of carbon dio.pdf 2. What colour will methylene blue turn in the presence of carbon dio.pdf
2. What colour will methylene blue turn in the presence of carbon dio.pdfinfo639484
 
2. What age, on average, did people with tic disorders first start no.pdf
 2. What age, on average, did people with tic disorders first start no.pdf 2. What age, on average, did people with tic disorders first start no.pdf
2. What age, on average, did people with tic disorders first start no.pdfinfo639484
 
2. True or false Given a sample size n=14, the degrees of freedom is.pdf
 2. True or false Given a sample size n=14, the degrees of freedom is.pdf 2. True or false Given a sample size n=14, the degrees of freedom is.pdf
2. True or false Given a sample size n=14, the degrees of freedom is.pdfinfo639484
 
2. The standard normal distribution is the normal random variable X s.pdf
 2. The standard normal distribution is the normal random variable X s.pdf 2. The standard normal distribution is the normal random variable X s.pdf
2. The standard normal distribution is the normal random variable X s.pdfinfo639484
 
2. The figure below depicts three metapopulation patterns. The size o.pdf
 2. The figure below depicts three metapopulation patterns. The size o.pdf 2. The figure below depicts three metapopulation patterns. The size o.pdf
2. The figure below depicts three metapopulation patterns. The size o.pdfinfo639484
 
2. Movie Profit Modify the Movie Data program written for problem.pdf
 2. Movie Profit Modify the Movie Data program written for problem.pdf 2. Movie Profit Modify the Movie Data program written for problem.pdf
2. Movie Profit Modify the Movie Data program written for problem.pdfinfo639484
 
2. Saving and investment in the national income accounts The foliowin.pdf
 2. Saving and investment in the national income accounts The foliowin.pdf 2. Saving and investment in the national income accounts The foliowin.pdf
2. Saving and investment in the national income accounts The foliowin.pdfinfo639484
 
2. Let X1 be a binomial distributed rv with parameters n1 and p1, and.pdf
 2. Let X1 be a binomial distributed rv with parameters n1 and p1, and.pdf 2. Let X1 be a binomial distributed rv with parameters n1 and p1, and.pdf
2. Let X1 be a binomial distributed rv with parameters n1 and p1, and.pdfinfo639484
 
2. Label the diagrams Explain in detali electron transportchemiosmos.pdf
 2. Label the diagrams Explain in detali electron transportchemiosmos.pdf 2. Label the diagrams Explain in detali electron transportchemiosmos.pdf
2. Label the diagrams Explain in detali electron transportchemiosmos.pdfinfo639484
 
2. Evolutonary theory predicts that orgunisms should apgear in a secp.pdf
 2. Evolutonary theory predicts that orgunisms should apgear in a secp.pdf 2. Evolutonary theory predicts that orgunisms should apgear in a secp.pdf
2. Evolutonary theory predicts that orgunisms should apgear in a secp.pdfinfo639484
 
2. Biodiversity Theme 2 Metabolic Diversity - What are the different.pdf
 2. Biodiversity Theme 2 Metabolic Diversity - What are the different.pdf 2. Biodiversity Theme 2 Metabolic Diversity - What are the different.pdf
2. Biodiversity Theme 2 Metabolic Diversity - What are the different.pdfinfo639484
 
19.5 The balance sheet for Levy Corp. is shown here in market value t.pdf
 19.5 The balance sheet for Levy Corp. is shown here in market value t.pdf 19.5 The balance sheet for Levy Corp. is shown here in market value t.pdf
19.5 The balance sheet for Levy Corp. is shown here in market value t.pdfinfo639484
 

More from info639484 (20)

25. It is hypothesized that Californian populations of Sea Otters a..pdf
 25. It is hypothesized that Californian populations of Sea Otters a..pdf 25. It is hypothesized that Californian populations of Sea Otters a..pdf
25. It is hypothesized that Californian populations of Sea Otters a..pdf
 
24. Country A�s adult population is 100 million, and it is likely t.pdf
 24. Country A�s adult population is 100 million, and it is likely t.pdf 24. Country A�s adult population is 100 million, and it is likely t.pdf
24. Country A�s adult population is 100 million, and it is likely t.pdf
 
2.4 Ethernet was originally developed to support a shared media envir.pdf
 2.4 Ethernet was originally developed to support a shared media envir.pdf 2.4 Ethernet was originally developed to support a shared media envir.pdf
2.4 Ethernet was originally developed to support a shared media envir.pdf
 
2.6. (a) Find the frequency response H(ej) of the linear time-invaria.pdf
 2.6. (a) Find the frequency response H(ej) of the linear time-invaria.pdf 2.6. (a) Find the frequency response H(ej) of the linear time-invaria.pdf
2.6. (a) Find the frequency response H(ej) of the linear time-invaria.pdf
 
2.Cases. Soulful Sounds Records inc. iby Ales Fither. aipecti ef t.pdf
 2.Cases. Soulful Sounds Records inc. iby Ales Fither. aipecti ef t.pdf 2.Cases. Soulful Sounds Records inc. iby Ales Fither. aipecti ef t.pdf
2.Cases. Soulful Sounds Records inc. iby Ales Fither. aipecti ef t.pdf
 
20. If the process of completing business requirements is difficult i.pdf
 20. If the process of completing business requirements is difficult i.pdf 20. If the process of completing business requirements is difficult i.pdf
20. If the process of completing business requirements is difficult i.pdf
 
2.2 A Network Topology is the arrangement with which computer systems.pdf
 2.2 A Network Topology is the arrangement with which computer systems.pdf 2.2 A Network Topology is the arrangement with which computer systems.pdf
2.2 A Network Topology is the arrangement with which computer systems.pdf
 
2.3 Decapsulation is the inverse of the encapsulation process. Encaps.pdf
 2.3 Decapsulation is the inverse of the encapsulation process. Encaps.pdf 2.3 Decapsulation is the inverse of the encapsulation process. Encaps.pdf
2.3 Decapsulation is the inverse of the encapsulation process. Encaps.pdf
 
2. What colour will methylene blue turn in the presence of carbon dio.pdf
 2. What colour will methylene blue turn in the presence of carbon dio.pdf 2. What colour will methylene blue turn in the presence of carbon dio.pdf
2. What colour will methylene blue turn in the presence of carbon dio.pdf
 
2. What age, on average, did people with tic disorders first start no.pdf
 2. What age, on average, did people with tic disorders first start no.pdf 2. What age, on average, did people with tic disorders first start no.pdf
2. What age, on average, did people with tic disorders first start no.pdf
 
2. True or false Given a sample size n=14, the degrees of freedom is.pdf
 2. True or false Given a sample size n=14, the degrees of freedom is.pdf 2. True or false Given a sample size n=14, the degrees of freedom is.pdf
2. True or false Given a sample size n=14, the degrees of freedom is.pdf
 
2. The standard normal distribution is the normal random variable X s.pdf
 2. The standard normal distribution is the normal random variable X s.pdf 2. The standard normal distribution is the normal random variable X s.pdf
2. The standard normal distribution is the normal random variable X s.pdf
 
2. The figure below depicts three metapopulation patterns. The size o.pdf
 2. The figure below depicts three metapopulation patterns. The size o.pdf 2. The figure below depicts three metapopulation patterns. The size o.pdf
2. The figure below depicts three metapopulation patterns. The size o.pdf
 
2. Movie Profit Modify the Movie Data program written for problem.pdf
 2. Movie Profit Modify the Movie Data program written for problem.pdf 2. Movie Profit Modify the Movie Data program written for problem.pdf
2. Movie Profit Modify the Movie Data program written for problem.pdf
 
2. Saving and investment in the national income accounts The foliowin.pdf
 2. Saving and investment in the national income accounts The foliowin.pdf 2. Saving and investment in the national income accounts The foliowin.pdf
2. Saving and investment in the national income accounts The foliowin.pdf
 
2. Let X1 be a binomial distributed rv with parameters n1 and p1, and.pdf
 2. Let X1 be a binomial distributed rv with parameters n1 and p1, and.pdf 2. Let X1 be a binomial distributed rv with parameters n1 and p1, and.pdf
2. Let X1 be a binomial distributed rv with parameters n1 and p1, and.pdf
 
2. Label the diagrams Explain in detali electron transportchemiosmos.pdf
 2. Label the diagrams Explain in detali electron transportchemiosmos.pdf 2. Label the diagrams Explain in detali electron transportchemiosmos.pdf
2. Label the diagrams Explain in detali electron transportchemiosmos.pdf
 
2. Evolutonary theory predicts that orgunisms should apgear in a secp.pdf
 2. Evolutonary theory predicts that orgunisms should apgear in a secp.pdf 2. Evolutonary theory predicts that orgunisms should apgear in a secp.pdf
2. Evolutonary theory predicts that orgunisms should apgear in a secp.pdf
 
2. Biodiversity Theme 2 Metabolic Diversity - What are the different.pdf
 2. Biodiversity Theme 2 Metabolic Diversity - What are the different.pdf 2. Biodiversity Theme 2 Metabolic Diversity - What are the different.pdf
2. Biodiversity Theme 2 Metabolic Diversity - What are the different.pdf
 
19.5 The balance sheet for Levy Corp. is shown here in market value t.pdf
 19.5 The balance sheet for Levy Corp. is shown here in market value t.pdf 19.5 The balance sheet for Levy Corp. is shown here in market value t.pdf
19.5 The balance sheet for Levy Corp. is shown here in market value t.pdf
 

Recently uploaded

Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 

Recently uploaded (20)

Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 

28.1 LAB Parsing food data Giveri a text file corsaining the swalabi.pdf

  • 1. 28.1 LAB: Parsing food data Giveri a text file corsaining the swalability of tood items witse a program that reads the information from the text file and outputs the avalable food inems. The program first reads the name of the text file from the user. The program then reads the text fle, stores the informatian into fou separate lists, and cutbus the avalable food iterns in the following format name (categary) - description Assume the text file contains the category, name description, and avalability of at least one food item, separated by a tab character (W). Ex if the input of the program is: food.txt and the contents of food bxt are