Question
C++ DATA STRUCTURES Write a c++ program that inputs a text file (size unknown), where each line of text on the file is no more
C++ DATA STRUCTURES
Write a c++ program that inputs a text file (size unknown), where each line of text on the file is no more than 80 characters in length.
Write C++ program to extract the words only from text file and insert each word in an ordered linked list. After storing all the words in alpha order in a linked list, print each word (once) and its frequency (the number of times it occurs in the file).
Sample input:
the quick brown fox ran.
the silver fox took 2 steps.
the rabbit ran.
Output: ( Write output to a file)
brown 1
fox 2
quick 1
rabbit 1
ran 2
steps 1
silver 1
the 3
took 1
Total = 13
The word [the] occurs with the greatest frequency.
SAMPLE TEST DATA
The open door banged loudly as the strong wind blow with 100 mile per hour gail force. We will not survive this storm he, said the he grabbed is cell phone abd called 911 for help. Will they come to help us? Is the storm to strom for first responders to respond to 911 emergency calls. What can we do to save ourselves, nothing going to work, if we could just close that door. I have called at least 10 times but no reply, maybe the cell towers are down. Where is our survival gear, did you packet in our supplies? This is going to be a long, long, long, long, long, long, long, long night. stay tuned for the next episide of this story, it is not over yet, it's going get more strange in the coming days.
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