Goals
- to write programs properly- to do File I/O reading a text file of words- to use File Dialog Box to pick files- to use HashMap and Sorted Dictionary to hold and access information- to Search for items using a HashMap- to write methods and use parameters effectively
OverviewFor this assignment, read the power point on Hashing functions. Then you will write a program to read in words (from a file in the starter code called ‘War and Peace.txt’) and store them in a data structure and print them out in sorted order. The function that reads in the words will use a while loop with a file. This application will read in the text of a book (say,The Old Man and the Sea or War and Peace) and then lets the user type words to search, and tells whether those words are contained in the bookor not and how many times that word is used in the book.
Use a Hashmapand / or a Sorted Dictionary (see in class demo) to count the number of times each word is used and print that count out. Add a File Dialog box to select which e-book to use (see in class demo). Please see the powerpoint lecture for HashMap code you may need in this assignment. Note Progress Bar is extra credit. Make sure you find hyphenated words like star-shaped, well-known, abstiens-toi, etc (see example below).
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here