Objective of this assignment : Read the input file information as a dictionary.
ID: 3534227 • Letter: O
Question
Objective of this assignment :
Read the input file information as a dictionary. Compare the entered word
with the words in the dictionary.
Step 1.
Open an input and an output file.
Step 2.
Read contents (20 words) from the input file.
Step 3.
Receive a word from a user and compare it to the words in the dictionary.
Show the index number if found in the dictionary. If not found, state
that. (See the output example below.)
Step 4.
Repeat step 3 until the user decides to quit.
Step 5.
Record the entire session to the output file.
Step 6.
Close both input and output files.
Explanation / Answer
Edited something I used for a 20,000+ word dictionary. Works fine on DevC++ if you run into any errors just come back and ask and i'll try to resolve it. Not sure if it fits your class as I don't know the limitations of what you can and cannot use. This includes dynamic allocation for the dictionary as well as binary searching to find the word since it is alphabeticalized. Enjoy!
http://ideone.com/4NusOM
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.