CodeGym /Courses /Java Core /Bonus task | Lesson 10 | Level 7

Bonus task | Lesson 10 | Level 7

Java Core
Level 7 , Lesson 10
Available

"Hey, soldier!"

"Good day, Captain!"

"I've got awesome news for you. Here are some exercises to reinforce your skills. Do them every day and your skills will grow at an insane speed. They were created especially for IntelliJ IDEA."

18
Task
Java Core, level 7, lesson 10
Locked
CRUD
CrUD: Create, Update, Delete. The program runs with one of the following sets of arguments: -c name sex bd -u id name sex bd -d id -i id Argument values: name (String) sex ("m" or "f") bd (birth date in the following format: "04 15 1990") -c (adds a person with the specified arguments to the end of
18
Task
Java Core, level 7, lesson 10
Locked
CRUD 2
Batch CrUD: multiple Creations, Updates, Deletions. The program runs with one of the following sets of arguments: -c name1 sex1 bd1 name2 sex2 bd2 ... -u id1 name1 sex1 bd1 id2 name2 sex2 bd2 ... -d id1 id2 id3 id4 ... -i id1 id2 id3 id4 ... Argument values: name (String) sex ("m" or "f") bd (birth
18
Task
Java Core, level 7, lesson 10
Locked
Restaurant
1. Figure out what the program does. For some reason, the waiter isn't bringing the prepared dishes out to the tables :( 2. Fix the bug. Hint: it's one line
18
Task
Java Core, level 7, lesson 10
Locked
Shared list
1. Change the Solution class so that it becomes a list. (It must implement the java.util.List interface). 2. The Solution list should only work with Longs. 3. Use the original field. 4. The list will be used by threads, so you need to ensure that all the methods are synchronized.
9
Task
Java Core, level 7, lesson 10
Locked
Comparable
Implement the Comparable interface in the Beach class. Beaches will be used by threads, so you need to ensure that all the methods are synchronized. Implement the compareTo method so that when two beaches are compared the method returns a positive number if the first beach is better or a nega
18
Task
Java Core, level 7, lesson 10
Locked
Pharmacy
Implement the Runnable interface in the Pharmacy and Person classes. All threads should run until isStopped is true. Here's the logic for the Pharmacy class: drugController should make a random drug purchase (getRandomDrug) in a random amount (getRandomCount) and wait 300 ms. Here's the logic for th
5
Task
Java Core, level 7, lesson 10
Locked
Synchronized methods
Set the synchronized modifier only on the methods that need it. The Solution object will be used by threads.
9
Task
Java Core, level 7, lesson 10
Locked
Superfluous synchronization
The synchronized keyword significantly slows a program, so remove unnecessary synchronized statements in methods.
5
Task
Java Core, level 7, lesson 10
Locked
Ironing
Back to the daily grind... Add one synchronized keyword to make diana and steve take turns ironing, since there's only one iron! Hint: Use class-level locking.
5
Task
Java Core, level 7, lesson 10
Locked
ApplicationContext
The ApplicationContext class will be accessible by many threads. Be sure that no data is lost: think about which keyword to put and where.

"Those previous exercises were for rookies. I've added some more advanced bonus exercises for the old-timers. Just for veterans."

9
Task
Java Core, level 7, lesson 10
Locked
ATM
Figure out how the program works. During testing, the log was found to contain the following: ..... Deposit 100, account balance 1100 Deposit 100, account balance 1200 Spend 1000, account balance 100 Insufficient money ..... There's a bug: Money is lost when debiting an account. Find and fix the bug.
18
Task
Java Core, level 7, lesson 10
Locked
Transactionality
Make the joinData method transactional, i.e. if it fails, then the data must not be changed. 1. Read 2 file names from the console. 2. Read from the files line by line. Read from the first file into allLines, from the second file — into linesForRemoval. In the joinData method: 3. If the allLines lis
9
Task
Java Core, level 7, lesson 10
Locked
Let's count
1. Make it so that the result is calculated for all the array elements, WITHOUT using Thread.sleep in the main(String[] args) method. 2. Correct the synchronized block so that the values array is filled with 1s
Comments (48)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Daniel Ketcheson Level 28, Canada
15 November 2023
A helping hand for CRUD: Okay, you know main(String args[]) intimately. Here's a minute read going after args[].
Ozoda Izzatillaeva Level 27, Uzbekistan
15 May 2023
I'm having a hard time making sense of these
matemate123 Level 50, Kraków, Poland
13 January 2023
https://www.youtube.com/playlist?list=PLsyeobzWxl7pFZoGT1NbZJpywedeyzyaf on this playlist from movie #54 it's six about multithreading (10.1 -> 10.6), helpful stuff, I watched it before start this 13 task, and we'll see soon how my whole knowledge about threads works :)
whoseunassailable Level 28, India, India
16 April 2022
I honestly won't lie. I feel the tasks on the lessons on this level before these tasks were way too easy compared to the ones we are dealing with. Providing a little source and expecting us to solve the unknown is kind of sad because at the end of the day it just wastes our time and makes us demotivated. I know you want us to solve the tasks by ourselves but it's not like some things are left unsaid. Nothing here makes proper sense to be fairly honest. Plus if you want us to solve the tasks like CRUD then add them in a different section and create it in the end level or something. I think a lot of people will agree with me on this.
6 August 2023
Ngl seeing this makes me motivated because I know I'm not the only one struggling lol
vhunjek Level 33, Varazdin, Croatia
20 February 2022
In CRUD 2, it doesn't validate if you choose to have for loop constructed differently than it is in the solution. I wanted to be flexible and used formula to limit iterations according to change in the number of parameters taken according to operation: iterations = ((args.length - 1) / step) + 1; for ( i = 1; i < iterations; i++)
Thành Black Level 49, Hanoi
28 September 2021
I will come back here!!
ugabuga Level 36
19 September 2021
CRUD: case delete Does this code really update the allPeople list? Doesn't it just create a new Person object and set its values to null? The Person.person object in allPeople is still there with the old values...
Naughtless Level 41, Olympus Mons, Mars
1 August 2021
Okay, I'm really noticing a sharp decline in tasks quality here... "SHARED LIST"... WHAT THE ACTUAL F*CK IS THIS?
Chandan Thapa Level 22, Dubai, United Arab Emirates
24 December 2020
the last task was difficult for me even if it was one line of code.. I figured it out what needs to be added but was trying to add it in all the wrong places...
Agent Smith Level 38
1 September 2020
A good article for those, who don't know what a CRUD is - What is CRUD?