I am the best
1 The best is the enemy of the good

2 It’s a hard work becoming the best
There will always be someone who began earlier. Someone had rich parents, someone studied in the world’s best university. Someone got a job with his parents help. Don’t fret. It happens. It’s called different starting conditions. Yet people like these are minority, the world is filled with people who succeeded due to “thinking outside the box”, hardworking and the desire to learn all the time. Life is like playing card game. Everyone can win having all trumps on hand, but professional wins no matter what cards he has. He diminishes the trumps’ influence with his skill. No one comprehends it as fully as professional sportsmen do. Many of them only have a few years to grasp their chance and become successful.3 There is always someone who works more then you

4 Unfriendly environment

5 To sum up
Still businessmen are the ones creating workspaces. Hired workers’ salary is the result of business competition for best workers. The more businesses there are in the country, the higher the salaries are. There is a huge rivalry on “work more” path, this way no longer works. You need to find another. You need to love your life and your time. Money is just the instrument which makes you independent financially. If you are financially independent, you may do what you want and not do what you don’t want. Be careful with “sacrifices” on the road to becoming best. Do not sacrifice the most important things: family, friends, health, job you love. Being financially successful in 50 without having family, friends, health and hating your job is no success. It’s a failure.Level 4

1 Risha, Scope of variables
- The professor still stands pat. Those old lecturing wrinkles are all the same. All he tells you is written in books. Bear in mind that no one has ever learned to swim after a dozen of lectures. Lectures help when you definitely understand a subject and know it a little less than a professor himself. - Professor’s lectures are of avail indeed. - Yeah... or rather, we hope they are. The more points of view on the same stuff you hear, the more you wonder how things really are. With just one point of view, you either believe it or not. Okay, let’s get down to business. - Take a look at the picture I gave you before:






2 Diego, Tasks for visibility of variables
- Hey, Amigo. - Hey, Diego. - I brought you a couple of tasks for visibility of variables
3 Risha, A command and a command block
- Now I’ll tell you what the command and command block are. It’s quite simple. The method body consists of commands. Each command ends with a semicolon.

4 Elly, Conditional operator
- Hey, Amigo. Today I’ll explain you conditional operators. - The value of a program lies in its ability to act differently in different situations, otherwise it's useless. In Java, the mentioned ability is realized by means of a «conditional operator». It is a special keyword that allows you to execute different command blocks depending on the trueness of a condition. - Conditional operator consists of three parts: «condition», «command 1» and «command 2». If the condition is true, then «command 1» is executed, otherwise «command 2» is executed. Commands are never executed at the same time. This operator looks as follows:

5 Bilaabo, Comparing with Pascal
- Hey, Amigo. Do you remember, we use more advanced Pascal on our planet. That’s what it all would look like in Pascal.
6 Diego, Tasks
- I’d like to tell you a little bit about the comparison of variables in Java. - You already know about the simplest comparison operators less-than (<) and greater-than (>). - Yeah. - There are also an "equal-to" (==) and "not-equal-to" (!=) operators. And there are "less-than-or-equal-to" (<=) and "greater-than-or-equal-to" (>=) operators as well. - Oh, that’s more exciting thing. - Note that there are no operators «=>» and «=<» in Java! - The sign «=» is used for the assignment operator, so we have to use double equals signs «==» to indicate equality. To check that the variables are not equal, use «!=». - Fair enough. - A comparison of two variables in Java using an operator «==» is a comparison of what these variables contain. - That is, values are compared in primitive type variables. - In reference type variables references are compared. So, if the objects are identical inside, but their references are different, the comparison shows that they are not equal: the result of the comparison is false. The reference comparison result is true, only if both references point to the same object. - A special method equals is used to compare objects by their content. The compiler adds this method (and all the methods of the Object class) to your class, even if you don’t declare it. Let me explain it through examples:
Practical tasks | |
---|---|
1 | Minimum of two numbers Write a program that reads two numbers from keyboard and displays to the screen the minimum of these numbers. |
2 | Maximum of four numbers Write a program that reads four numbers from keyboard and displays to the screen the maximum of these numbers. |
3 | Sort three numbers Write a program that reads three numbers from keyboard and displays them in descending order. |
4 | Compare names Write a program that reads two names from keyboard, and if the names are the same, displays «Names are identical». Display «Name lengths are equal» if the names are different, but their lengths are equal. |
5 | 18+ Write a program that reads a name and age from keyboard. If the age is less than 18 display «Grow up a little» |
6 | 18 is enough Write a program that reads a name and age from keyboard. If the age is more than 20 display «18 is enough» |
7 Kim talks about a boolean type
- Hey, Amigo. I want to tell you about a new data type. It’s a boolean type. Variables of this type сan take just two values: true and false. - How to use it? - This type is hiddenly used in many places. Just like a number is the result of any addition, a boolean type – true or false – is the result of any comparison. Examples:



8 Elly, While Loop
- Hi. - Hi, Elly! - It’s… time to learn about loops! They are just as simple as conditions, but more interesting. A loop enables any command or command block to be executed several times. A loop looks as follows:

9 Bilaabo, Comparing with Pascal
- Hi, bud. Bilaabo will now tell you what it all would look like in Pascal.
10 Diego, Loop tasks
- Hey, Amigo! - I heard you’ve learned loops. What if I give you some more tasks?Loop tasks | |
---|---|
1 | 10 numbers Write a program that displays numbers from 1 to 10. Use “while” loop. |
2 | 10 numbers in reverse order Write a program that displays numbers from 10 to 1. Use “while” loop. |
3 | You can never have too much of a good thing Write a program that reads from keyboard a string and number N. Program should display to the screen the string N times. Use “while” loop. Example input: abc 2 Example output: abc abc |
4 | S-square Write a program that displays to the screen a square 10x10 of “S” characters. Use “while” loop. Don’t separate characters in the same line. |
5 | Multiplication table Write a program that displays multiplication table of 10 by 10. Use “while” loop. Separate numbers by a space. Example output: 1 2 3 4 5 6 7 8 9 10 2 4 6 8 10 12 14 16 18 20 3 6 9 12 15 18 21 24 27 30 ... |
11 Elly, For Loop
- I want to tell you about one more loop. It is called for. This loop is another record of the while loop. It’s just more compact and handy for programmers. Examples:
12 Bilaabo, Comparing with Pascal
- Amigo, believe it or not, but in Pascal there is loop For, too. It is actually in almost all programming languages. But it’s much easier to understand in Pascal. Look:
13 Diego, Tasks
- Today is my lucky day. I came up with 5 new tasks for you. My creativity’s too evident. Good luck to you my friend. You’ll need it…“for” loop tasks | |
---|---|
1 | Even numbers Write a program that displays even numbers from 1 to 100 separated by spaces or each on a new line. Use “for” loop. |
2 | Draw a rectangle Write a program that reads from keyboard two numbers: m and n. The program should display to the screen a rectangle composed of eights sized m by n. Use “for” loop. Example: m=2, n=4 8888 8888 |
3 | Draw a triangle Write a program that displays a right triangle composed of eights with sides 10 and 10. Use “for” loop. Example: 8 88 888 ... |
Draw lines Write a program that displays
|
|
5 | Everybody loves somebody Write a program that reads from keyboard name. Use “for” loop to display 10 times the text: «name» loves me. Example text: Pam loves me. Pam loves me. … |
14 Professor
- Hi, Amigo. How is it going for you? - Things are going well, Professor Noodles. I’ve already learned “for” and “while” loops. - Great! It figures that Professor Noodles is world’s best teacher. Together we’ll triumph over all those narrow-minded who contend that we should start with practice. You’re my living proof, if I may say so about a robot. Click on the link, you’ll find there something useful: CodeGym Lecture 4 Discussion15 Julio
- Hey, Amigo! I have to give you something today, but first let’s watch TV a little, and then proceed, OK?16 John Squirrels. Captain John Squirrels
- Hello, soldier! - Good morning, sir! - I have some awesome news for you. Here’s a quick check to reinforce your skills. With every day practice you’ll enhance your skills real quick. Tasks are specially designed to do in Intellij IDEA.Additional tasks to do in Intellij Idea | |
---|---|
1 | 1. I’ll never work for peanuts Write a program that displays hundred times a sentence: «I’ll never work for peanuts. Amigo». Use “for” loop. |
2 | 2. Display an average Write a program that reads from keyboard three numbers. The program should display to the screen the average of these numbers, that is, neither the biggest nor the smallest one. |
3 | 3. Calculate a sum Write a program that reads from keyboard numbers and calculates their sum. If the user enters -1, the program should display the sum and terminate. -1 should be included in sum. |
4 |
4. My name’s ‘Joe’... Write a program that reads from keyboard a string «name» and a date of birth (three numbers): y, m, d. The program should display to the screen: «My name’s «name» I was born on d.m.y» Example: «My name’s Joe I was born on 15.2.1988» |
GO TO FULL VERSION