"Hello, soldier!"

"Hello, Captain Squirrels, sir!"

"Here are some exercises to level-up your skills and solidify knowledge."

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.