Question
Develop a program to read in the market basket data from a text file with the following format and identify the unique items printed on
Develop a program to read in the market basket data from a text file with the following format and identify the unique items printed on the screen.Continue your program to count the frequency each unique item. Please note that comments are part of the file but not the data. You are NOT allowed to modify the file format. You are free to chose the language. There will be more phases. So, make sure that you come up with a nice, well designed modular approach. You have to submit the code, the content of the data file, and the screen shot of the output as ONE file together.
-- market.data ---
6 //# of transactions
1, 3, gum, bread, napkin //transaction id, # of items purchased, item1, item3,...
2, 1, gum
3, 2, fruit, bread
4, 5, milk, bread, napkin, fork, juice
5, 3, juice, napkin, milk
6, 2, bread, spoon
Output for your program would look like this:
There are 8 unique items: gum, bread, napkin, fruit, milk, fork, juice, spoon.
Item Name Frequency
gum ............................... 3
bread ............................11
napkin ............................7
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