4
Görev
Java Syntax, seviye, ders
What's the cat's name?
The first thing a person/robot/variable receives after it is born/spawned/created is a name. Our brains aren't very comfortable with the idea of a world without names and titles. Let's come to their rescue: let's create a special automated naming method that sets the value of the private String variable name, i.e. names the object.
2
Görev
Java Syntax, seviye, ders
Cat register
Sometimes an acute shortage of cats is felt more keenly than hunger. To combat this unpleasant feeling, you need to implement the addNewCat method, which will add a new cat to your program each time it is called. Use it carefully. More cats means more responsibility. Don't forget to increase the counter by one each time a cat is created.
2
Görev
Java Syntax, seviye, ders
Setting the number of cats
Sally Johnson used to work at the buffet at the Podunk intergalactic station on Terra, but she stopped upon reaching retirement age. Now she collects cats. Over the years, it has become difficult to control the number of purring creatures: cats reproduce rapidly. We won't solve this problem for Sally, but we will write a method that records the number of cats.
2
Görev
Java Syntax, seviye, ders
Name register
Planetary Consul General Rufus Andrew Shaw got stuck on the intergalactic railway because the program responsible for registering the pets of the Federation's diplomatic passengers malfunctioned. The program's method for recording names is broken. Let's fix the situation: we'll write the setName method that the railway workers need.
2
Görev
Java Syntax, seviye, ders
Cats in the Universe
In 2010, cats took control of the Internet, and in 3258 they achieved a soft coup of Planet PurPurr, which is at the center of the Galaxy Rush planetary system. A coup is soft when no one is against it. There was one problem: there were a lot of cats, and despite their dominant position, they essentially don't know how to count. Let's help them with a counter.