Download The text file, named “wordlist.txt”, contains 58000 sample English

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
CSC 108 3.0 Object Oriented Programming
Lab Exercises No. 12
Exercise 12-1
The text file, named “wordlist.txt”, contains 58000 sample English words. Write a Java
program to extract the following information from the sample data set and print the results on
the screen as given below.
Information required:
1. The frequency of number of letters in a word
2. The maximum number of letters in a word
3. The number of palindromes
4. Total number of words in the list
English language statistics
------------------------------------No. of letters
No. of words
in a word
(frequency)
------------------------------------1
2
3
4
0
3
25
...
------------------------------------Maximum numbers of words are available with xx letters
Sample data set contains xx palindrome words
Total number of words in the sample is xx
Notes: 1. Copy the file “wordlist.txt” given on the LMS to your working directory.
2. Each word is given on a separate line on the file. (i.e. one word per line)
3. A palindrome is a string that is spelled the same way forward and backward. An
example is “radar”.
Department of Statistics and Computer Science
University of Sri Jayewardenepura