Joomla Vorlagen by Website Hosting

PL1 - 11th laboratory (Strings)

Work on the project

Work with text in the "Book" class.

1. Calculate the frequency of vowels regardless of the case. Use the "length", "charAt", and "toLowerCase" methods.

2. Calculate the frequencies of the 'old man' and 'the sea', regardless of the case. Use the "toLowerCase" and "indexOf (String str, int fromIndex)" methods.

3. Calculate the frequency of the 'old man' and 'the sea', regardless of the case. Use Pattern, Mattern. Compare the results to the previous task.

4. Calculate the total number of words. Use the split method and the appropriate regular expression to define punctuation between words.

Work with text in the "Html" class.

5. Find all hyperlinks in html. Use the Matcher and Pattern classes.

Use URL, URLConnection, and I / O streams for the following.

6. Create helper methods en.kozusznik.pl1.utils.IORoutines.readPage to download the entire page content as String. Use it to get and process it as in Task 5.


Find all the palindromes in the text (Book.toString ()) that are longer than one character - use the principle to search for words in the text (task 4) and test each word to see if it is a palindrome.

From - save it locally using your browser and use the cz.kozusznik.pl1.utils.IORoutines.readFile method or use the cz method directly .kozusznik.pl1.utils.IORoutines.readPage - extract all links to images to serve as wallpaper - the "alt" attribute includes the text "nature wallpapers". Save only the file names in the list and sort the list by image size (height * width) and then by name.

Download the first 5 images using URL, URLConnection and save to a disk named Picture_ <order-number>. <suffix>.