undefined

Final tasks

Java Syntax
Level 7 , Lesson 12
Available

"Hello, soldier!"

"Hello, Captain Squirrels, sir!"

"I have great news for you. Here are some exercises to reinforce your skills. Work on them every day, and your competence will grow exponentially. They were specially designed for IntelliJ IDEA."

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

undefined
2
Task
Java Syntax, level 7, lesson 12
Locked
Display numbers in reverse order
You know that you can solve problems in many ways, right? Yes, of course you know that. However, in this particular task we'll ask you to recall the for loop and use it to perform some manipulations. Here's what you need to do: enter 10 numbers from the keyboard, put them in a list, and then display them in reverse order.
undefined
10
Task
Java Syntax, level 7, lesson 12
Locked
Shuffled just in time
Games with lists are the best! Does that sound like an advertisement? Perhaps the best advertisement for a programming language is its frequent use. Let's advertise lists as we complete this task: enter numbers m and n, enter n strings and put them in a list. Then perform a simple manipulation: move the first m strings to the end of the list
undefined
5
Task
Java Syntax, level 7, lesson 12
Locked
Min and max in arrays
The Fault Line residential zone has only 20 houses, but their numbers were assigned haphazardly. It turns out that Fault Line's starting and ending numbers were set randomly. That's what makes it so interesting and unpredictable! Let's write a little Fault Line emulator: we'll determine where its begins and where it ends. To do this, we'll cram the housing block into an array, populate it with house numbers, and find the largest and the smallest among them.
undefined
5
Task
Java Syntax, level 7, lesson 12
Locked
The end
Let's create a list of strings, entering them from the keyboard until you get bored. You might get bored at any moment, and we need to come up with a special word to signal this. Let's use the word "end". And why do we need these strings, you ask? And we answer: So we can add them to a list, and then display them.
undefined
2
Task
Java Syntax, level 7, lesson 12
Locked
Countdown
We're all for peace and fighting terrorism, but we'll write a countdown program just the same. Our program should count from 30 to 0 and then end with a "Boom!". Don't worry. The "Boom!" will be peaceful, silent text. The program should advance the countdown 10 times per second. To add a delay to the program, use Thread.sleep(100);
undefined
10
Task
Java Syntax, level 7, lesson 12
Locked
Family census
Let's try to create a program for a family census. To do this, we'll write a Human class with String name, boolean sex, int age, Human father, and Human mother fields. To practice, create objects and fill them with data so we end up with two grandparents, two grandmothers, a father, a mother, and three children. Display the objects on the screen.
undefined
2
Task
Java Syntax, level 7, lesson 12
Locked
Move one static modifier
Not everyone can be static! And if a static modifier ends up where it shouldn't be, anything could happen! This is exactly what happened in the code you'll see once you open this task: one static modifier ended up in the wrong place. Help the program compile by putting the modifier where it belongs! Thanks.
undefined
5
Task
Java Syntax, level 7, lesson 12
Locked
Cat code won't compile
The first postulate of the intergalactic railway states: if cats have a problem, abandon everything to help them solve it. Because having problems is contrary to the nature of cats. So we have a program that displays cat data after reading it from the keyboard. But something isn't right, and it won't compile. Fix the bug!
undefined
5
Task
Java Syntax, level 7, lesson 12
Locked
Changing functionality
An ancient completed task is gathering dust in the archive. It requires you to enter strings until an empty string is entered. Then all letters in the strings are converted to uppercase. Let's modernize the task: The program should build a new list. If a string has an even number of letters, then the string is duplicated. If the number of letters is odd, then the string is repeated three times. We'll leave the string input part unchanged.
undefined
5
Task
Java Syntax, level 7, lesson 12
Locked
In decreasing order
The ordered isomorphs of Planet Linear Chaos love to sort and accept into their ranks those who are proficient at sorting. What's that you say? You don't plan on associating with them? That won't work: isomorphs are often the ones conducting interviews at IT companies. We won't ignore them: write a program that reads 20 numbers from the keyboard and displays them in decreasing order.
Comments (37)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Sunaina Yadav Level 9 Ahmedabad India
27 January 2021
Cat code won't compile exercise gives java.lang.NullPointerException even when I download the correct solution and it passes testing. I tried while(true){ String name = reader.readLine(); int age= Integer.parseInt(reader.readLine(); int weight=Integer.parseInt(reader.readLine(); int tailLength=Integer.parseInt(reader.readLine(); then pass these values to the constructor. But it keeps giving me NumberFormatException Don't know what is wrong with this but got an answer that I am trying to convert null to int.
Mihai Bone Level 8 Bucharest Romania
14 December 2020
Family census: Tips - Don't try like me to recreate their output ...... just display 4 objects with 3 parameter and 5 objects with 5 parameter
Brad Reed Level 19 Hartford United States
2 July 2020
raise your hand if you've been victimized by predictive text... I know I have LOL
Mayu Level 25 Toronto Canada
3 June 2020
When it says the solution to the task is better than X% other students, what's the metric being used. Is it complexity or efficiency?
Kent Hervey Level 16 United States
20 November 2019
Shuffled Just in Time...I don't really understand what this means: Move the first M strings to the end of the list. Does it mean that for the sample data the output would be (move the first four to the end in order)... cat dog program car father mother son daughter ??
ashgolan Level 8 Ashdod Israel
10 November 2019
excellent :)
Miki Level 10 Tallinn Estonia
19 September 2019
It's probably my own problem but more and more often i find that description of task or problem is hard to understand. Many times don't understand what is needed and i have to start all over again. Not complaining though i know that most important is to keep coding and trying.
Alexandru Ovcinicov Level 15 London United Kingdom
13 July 2019
the last one... I looked at example from a lesson from Professor Noodles on arrays. loop inside loop , my mind had to adapt a bit to understand.. Thanks.Looks like all exercises on this lvl are done. Let's go further.
Ewerton Level 30 Belo Horizonte Brasil
27 June 2019
I don't want to do this many exercises, but I can't not do them haha. Tip: If you just want to keep looping until you call a break statement, you can do it using while or for:

while(1) {...}
for(;;)     {...}
Deep Maheshwari Level 10 Nanded India
24 June 2019
I'm trying to open plugins in IntelliJ but it is showing:- Error while signing in using a secret key. Check properties file.responseCode = 400 and I didn't get any Secret key