「こんにちは、兵士さん!」
「こんにちは、リス船長さん!」
「素晴らしいニュースがあります。スキルを強化するための演習をいくつかご紹介します。毎日取り組めば、あなたの能力は飛躍的に成長します。これらは IntelliJ IDEA 用に特別に設計されました。」
「以前の演習は新人向けでした。ベテラン向けに、さらに高度なボーナス演習を追加しました。ベテラン向けです。」
4
タスク
Java Syntax, レベル 5, レッスン 12
The whole duck isn't enough
This program implements a Duck class, and even creates two specific ducks (two objects). Create a couple more categories of animals similar to the Duck class, namely Cat and Dog. Figure out what the toString method should return in these classes and create pairs of each creature (meaning objects) and display them on the screen.
8
タスク
Java Syntax, レベル 5, レッスン 12
Man and woman
Creating classes is easy and fun. Let's feel like the creators of a virtual universe and create Man and Woman classes. They must be declared inside the Solution class and be public static. They need to have "name", "age" and "address" fields. We also need to declare constructors with all possible parameters. Then we will be able to use them to create specific objects.
4
タスク
Java Syntax, レベル 5, レッスン 12
Tom and Jerry
Remember the cartoon "Tom and Jerry"? If you're too young for this, Google will help. And here's why it matters: This cartoon has lots of cats, mice, and dogs. Our task now is to create three classes: Dog, Cat, and Mouse. Each should have three fields. Then create objects of these classes, naming them after the cartoon characters.
2
タスク
Java Syntax, レベル 5, レッスン 12
Display today's date
Sometimes programmers sit at the computer for days and get lost in time. So if some guy on the street asks you what year it is, it might not be Marty McFly. Maybe he just wrote code for too long. To not get lost, let's display the current date in the following format: "06 15 2018".
8
タスク
Java Syntax, レベル 5, レッスン 12
Console-based piggy bank
Imagine that we have a piggy bank. You can put coins in it until, at some point, you break it. Let's write a console-based emulator for this piggy bank: We will enter numbers from the keyboard and add them until we "break" the process using the special word "sum". Then the program should calculate how much you have saved.
2
タスク
Java Syntax, レベル 5, レッスン 12
Boss, something weird is happening
Other people's code is unknown territory. What awaits you there? Perhaps enlightened wolves who chant mantras, or bloodthirsty deer ready to tear your throat open... We don't want to frighten you, but we must warn you that other people's code is full of surprises. Let's dig into the program. In theory, it should sum up two numbers. Let's see what's wrong with it.
4
タスク
Java Syntax, レベル 5, レッスン 12
Improving functionality
The wisdom of programmers is captured in the following sentence: "If it works, don't touch it!". But what if you need to improve a program's functionality? Alas, 99% of the time, you still have to crawl into someone else's code. Well, let's get to it: there's a program that displays the minimum of two entered numbers. Rewrite it so that it does the same for 5 numbers.
8
タスク
Java Syntax, レベル 5, レッスン 12
Task about algorithms
Every classical algorithm has been programmed for a long time. Still, tasks about algorithms are very valuable. At the very least, they make the programmer think. There's nothing complicated about the algorithm to find the maximum. So let's not dilly-dally: write a program that takes a positive integer n, takes n numbers, and then finds the maximum of them.