„Здравей, Амиго. Справяш се страхотно. Ето едно ново упражнение за теб: напиши програма, която приема някои данни от клавиатурата и показва текст, който използва тези данни:“
6
Задача
Java Syntax, ниво, урок
Plan to conquer the world
"First, I'll complete the tasks, then I'm going to make a lot of money. Then I'll take over the world". We found this written in a modest young man's personal journal. Let's imagine he knows exactly when this will happen: we'll use the keyboard to enter a number (the number of years it will take to achieve his goal) and the name of the hopeful conqueror. Then we'll display an interesting phrase.
3
Задача
Java Syntax, ниво, урок
Predictions
Some predictions are quite logical. For example, if you become a real programmer, then you'll have a high salary after a while. You don't have to be Nostradamus to come up with that. Let's code up a program where we indicate a name and two numbers (a salary and a number of years). Then we'll display a phrase: " will receive in years".
1
Задача
Java Syntax, ниво, урок
The humble programmer
Dreams about employment as a programmer can't be contained! This is no surprise: The more tasks you finish, the closer you are to achieving your dreams. Let's take another step forward by tackling a task involving humility. Use the keyboard to enter the name of a person, and then display his or her salary. The details are in the task conditions.
1
Задача
Java Syntax, ниво, урок
Deep and pure love
Among humans, lovers usually form couples. But on some planets, triads are common (For example, Isaac Asimov wrote about them in his novel "The Gods Themselves"). Let's use a program to create a triad. We'll use the keyboard to enter the names of three lovers and then display their intense feelings for each other.
1
Задача
Java Syntax, ниво, урок
More conversions
Let's calculate the number of full feet in a certain number of inches. We'll create a special method (getFeetFromInches) to do this. Any remainder should be rounded. Thus, if we pass 243 inches to our method, then we will get only 20 feet, not 20.25.
3
Задача
Java Syntax, ниво, урок
Don't think about seconds…
If you stare at the second hand for a long time, you can feel how quickly and irretrievably time is slipping away.. Enough gawking at the second hand. Instead, let's figure out a task involving seconds.