CodeGym /Java Course /Java Core /Bonus task | Lesson 11 | Level 9

Bonus task | Lesson 11 | Level 9

Java Core
Level 9 , Lesson 11
Available

"Hello, Amigo! Enough messing around! Here are your tasks. They are going to be more difficult than the previous ones, and they'll be sure to improve your processor. And that's certainly something we need. If you run into difficulties, check with your colleagues. They'll definitely help."

20
Task
Java Core, level 9, lesson 11
Locked
Tracking changes
Read 2 file names from the console: file1 and file2. Both files contain text, but file2 is an updated version of file1. Some of the lines are still the same. You need to create a merged version of the lines by writing them to the lines list. The ADDED and REMOVED labels can't be used consecutively—t
20
Task
Java Core, level 9, lesson 11
Locked
Your own FileWriter
Implement FileConsoleWriter's logic. The FileConsoleWriter class must have a private FileWriter field called fileWriter. The FileConsoleWriter class must have every constructor used to initialize fileWriter for writing. The FileConsoleWriter class must have five write methods and one close method: -
20
Task
Java Core, level 9, lesson 11
Locked
Introducing tags
Read from the console the name of a file containing HTML. Example: Info about Leela Leela Turanga Supergirl The main method's first parameter is a tag name. For example, "span". Display all tags that match the speci
12
Task
Java Core, level 9, lesson 11
Locked
Calculating salaries
The first parameter of the main method is a file name. Each line of the specified file has the following format: name value where [name] is a String and [value] is a double. [name] and [value] are separated by a space. Find the sum of all the values for each name. Display all the data, sorted by na
12
Task
Java Core, level 9, lesson 11
Locked
The richest
The first parameter of the main method is a file name. Each line of the specified file has the following format: name value where [name] is a String and [value] is a double. [name] and [value] are separated by a space. Find the sum of all the values for each name. Display in alphabetical order the
20
Task
Java Core, level 9, lesson 11
Locked
John Johnson
The first parameter of the main method is a file name. Each line of the specified file has the following format: name month day year where [name] is a String that can contain several words separated by spaces. [month] is an int, [day] is an int, and [year] is an int. The data is separated by spaces.
12
Task
Java Core, level 9, lesson 11
Locked
Searching for the right lines
Read a file name from the console. Display all of the file's lines that contain only 2 words in the words list. Close the streams. Example: words contains the words A, B, and C Lines: C B A D // 3 words from words, rejected A B A D // 3 words from words, rejected D A D // 1 word from words, rejecte
12
Task
Java Core, level 9, lesson 11
Locked
Words with numbers
The main method's first parameter is file1 and the second is file2. file1 contains lines with words separated by spaces. Write to file2 all the words that contain numbers, for example, a1 or abc3d. Separate the words with spaces. Close the streams.
20
Task
Java Core, level 9, lesson 11
Locked
Replacing numbers
1. In a static block, initialize map with (number, word) pairs from 0 to 12 inclusive. For example, (0, "zero"), (1, "one"), (2, "two") 2. Read the file name from the console, and then read the contents of the file. 3. Use map to replace all of the numbers with words. 4. Display the result. 5. Close
12
Task
Java Core, level 9, lesson 11
Locked
Long words
The main method's first parameter is file1 and the second is file2. file1 contains words separated by spaces. Write to file2 a comma-separated list of words longer than 6 characters. file2 should not end with a comma. Close the streams. Example output to file2: lengthy,shortened,abbreviation

"You did everything already? Well, here are some exercises that are even more difficult:"

12
Task
Java Core, level 9, lesson 11
Locked
Mirror image
1. Read a file name from the console. Read the contents of the file. 2. For each line in the file: 2.1. reverse the order of all characters. 2.2. display the result. 3. Close the streams. Example input file: I'm a programmer. Amigo Example result: .remmargorp a m'I ogimA
12
Task
Java Core, level 9, lesson 11
Locked
Contextual advertising
Replace the System.out object in the main method with your own reader wrapper. Your reader wrapper should display a contextual ad after every other call to println. Call testString's existing printSomething() method. Restore the System.out variable back to the original stream. Ad text: "CodeGym - o
12
Task
Java Core, level 9, lesson 11
Locked
Correct the bug. Classes and interfaces
This program has just 1 logical error. Find and fix it.
Comments (46)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Untitled by Anon Level 49, Germany
24 May 2023
For the "introducing tags" task, I might have brainstormed and then scratched off ten different ideas about how to locate and break down individual nests. I finally made it work with lots of debugging, StringBuilder's insert function and the newline character. The actual nest opening is straightfoward.
Krzysiek Nowak Level 33, Poland, Poland
17 May 2023
In the "Searching for the right lines" there is a little mistake in a "correct solution", namely "readedString" instead of "readString" ;)
Tasmoda Level 28, Midrand, South Africa
18 August 2022
"You did everything already? Well, here are some exercises that are even more difficult:"😂🤣.. I'm seeing this while super stuck on the first task. I wonder what kind of a brain thinks up these tasks. Damn!
Justin Smith Level 41, Greenfield, USA, United States
21 October 2021
Whenever I get to this page of a level, it's always like "gonna be here for a while".
Gellert Varga Level 23, Szekesfehervar, Hungary
24 October 2021
It happens to me too...
Gellert Varga Level 23, Szekesfehervar, Hungary
17 October 2021
About task1924 Replacing numbers: TEST INPUT: az 1 ez 12 12. 12? 11- 11) amaz Bla2blabla 2. I1n 0 masodik 3 sor 5 5. 5* 5/ 8 In 7! vi4ew 9- 11 11b 11c a11b 6view 13, OUTPUT OF MY FIRST REJECTED CODE: az one ez twelve 12. 12? 11- 11) amaz Bla2blabla 2. I1n zero masodik three sor five 5. 5* 5/ eight In 7! vi4ew 9- eleven 11b 11c a11b 6view 13, OUTPUT OF MY SECOND REJECTED CODE: az,one,ez,twelve,twelve.,twelve?,eleven-,eleven),amaz,Bla2blabla,,two. I1n,zero,masodik,,three,,,sor,five,five.,five*,five/,,,,eight,In,seven! vi4ew,nine-,eleven,elevenb,elevenc,a11b,6view,13, ACCEPTED OUTPUT: az one ez twelve twelve. twelve? eleven- eleven) amaz Bla2blabla two. I1n zero masodik three sor five five. five* five/ eight In seven! vi4ew nine- eleven elevenb elevenc a11b 6view 13,
Thành Black Level 49, Hanoi
5 October 2021
three days for this task.
Jurij Thmsn Level 29, Flensburg, Germany
21 April 2021
first time I gave up on a task (Introducing tags) 😭 I'll try it again in the future. I hope RegEx and Matcher will be taught later in this course properly, I read like 10 tutorials on this, but still don't really know how to use it ("Replacing numbers" made this clear!)
Andrei Level 41
22 February 2021
Man, it took me I think about 3 weeks to finish this level, with almost half of that time spent on these tasks. It's done, yay!
Maxim Raitin Level 20, Tomsk, Russian Federation
20 July 2021
lol, How many hours do you spend per day?
Andrei Level 41
20 July 2021
I try 4 per work day. what's funny? 🙂
Chandan Thapa Level 22, Dubai, United Arab Emirates
18 January 2021
the hardest task so far in my codegym journey was tracking changes.. but wait that wasn't enough, Introducing tags took that place. Spent days on these two tasks. But learned a lot in the process, . :) Glad!
Seferi Level 22, United Federation of Planets
19 November 2020
I took the easy way out for the task 'introducing tags' and used Jsoup..