
"Szia, Amigo. Remekül csinálod. Íme egy új gyakorlat a számodra: írj egy programot, amely elfogad néhány adatot a billentyűzetről, és megjeleníti az ezeket az adatokat használó szöveget:"
6
Feladat
Java Syntax, szint, lecke
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
Feladat
Java Syntax, szint, lecke
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
Feladat
Java Syntax, szint, lecke
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
Feladat
Java Syntax, szint, lecke
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
Feladat
Java Syntax, szint, lecke
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
Feladat
Java Syntax, szint, lecke
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.