Homework and bonus exercises

Level 1, Lesson 11
Available

"Hey, dude!"

"I hope you're well, Captain Squirrels!"

"I've got awesome news for you. Here are some exercises to reinforce your skills. Do them every day and your skills will grow at an insane speed. They were specially created for you to perform in IntelliJ IDEA."

6
Task
Java Core,  level 1,  lesson 11
Locked
"He took one of his ribs"
Let's create a virtual man. Keeping with tradition, we'll call him Adam. And so he doesn't get lonely, we'll write him a derived class called Eve. Things might not play out quite like in the Bible story, but that's not what we're going for. We are simply trying to understand a very important part of OOP: inheritance.
6
Task
Java Core,  level 1,  lesson 11
Locked
Frenemies
In 2007, Apple announced the very first iPhone. Just as Steve Jobs promised, this event really did change the world. Smartphones have since evolved into all that they are today. The iPhone forced others to create a variety of imitations. Or descendents. Make the SamsungGalaxyS2 class inherit the AppleIPhone class. And may Google forgive us.
6
Task
Java Core,  level 1,  lesson 11
Locked
Playing Darwin
Every school in the Universe probably has classes covering Darwin's famous theory of evolution. So there was a fish, then a bird, then an amphibian, and then mammals... or maybe that's not quite right... But that's not important. In our program, we'll create a fish, a general animal class, an ape and a human. And the fourth will inherit the third, which will inherit the second, which will inherit the first.
6
Task
Java Core,  level 1,  lesson 11
Locked
Evolving classes
We've still got a little more world history to cover on the CodeGym website. Of course, you've heard how dinosaurs came from lizards, which in turn came from fish. This looks like another chance to practice OOP and inheritance. Create three "animal" classes: a parent class, a child class, and a child of the child class.
6
Task
Java Core,  level 1,  lesson 11
Locked
From student to skilled slave
Sigh. Sometimes life seems like it's just a slow transition from one form of slavery to another. First, we have to go to school, and then college, then work, and more work, and more work... until eventually we've been transformed from employees to slaves. Of course, that isn't our destiny. That's why we're learning how to program. Write four classes and make each inherit from the next.
6
Task
Java Core,  level 1,  lesson 11
Locked
Inheritance chain
The spaceship Galaxy Rush has dropped off supplies on Planet Canine in Beagle Galaxy. As a reward for a job well done, the crew was invited to a lecture on canine evolution. Sound boring? No way! It was on this glorious planet, that dogs - the crown jewel of evolution - descended from cats. But that's not how it happened for us! In this task, we'll use the more familiar evolutionary chain found on earth.
6
Task
Java Core,  level 1,  lesson 11
Locked
Alternative inheritance chain
Here we have a class for carnivores - animals and their descendants, such as cows, dogs, and pigs. Imagine what havoc a carnivorous cow could cause if it actually existed! We can't let that happen. Write the inheritance chain correctly!
6
Task
Java Core,  level 1,  lesson 11
Locked
Urban household
OOP may let us fantasize, but before long we need to return to the realm of common sense. For instance, you really like your car, but should you really think of it as a pet or, even worse, your lover? Let's make the inheritance in the program align with common sense.
6
Task
Java Core,  level 1,  lesson 11
Locked
Correct inheritance chain: part 4
"I thought of objects as living cells or individual computers on a network, only able to communicate with messages," said the man who introduced the term "OOP". (Google it if you need to!) We suggest you do the same. Create a proper "inheritance chain" for the House, Cat, Dog, and Car classes.
6
Task
Java Core,  level 1,  lesson 11
Locked
Correct inheritance chain: part 5
Andre, who breeds cats and dogs, doesn't know how to program. He has tearfully asked you to write a program that could help him keep track of his hard-earned assets. And for you that should be easy. Because, as it happens, you're studying OOP and inheritance.

"Those were for rookies. I've added some more advanced bonus exercises for the more experienced. Just for veterans."

6
Task
Java Core,  level 1,  lesson 11
Locked
Strange unfamiliar code
You already know that you'll often have to make sense of unfamiliar code, and that's not just because you're a "junior developer". Here at the secret CodeGym headquarters, we know that it's best to just get used to working with unfamiliar code from the outset. In this task, we'll rearrange the class inheritance so the program compiles and runs.
6
Task
Java Core,  level 1,  lesson 11
Locked
Save the chess club
At CodeGym, we love intellectual diversions. And that includes chess. The king, queen, bishop, rook and pawn are all the pieces used in the game. In this task, you'll have to correct and complete unfamiliar code. More specifically, you need to create a common parent ("chess piece") for all the chess pieces.
6
Task
Java Core,  level 1,  lesson 11
Locked
Minimum and Maximum
During his pre-school entrance exam, Alex, an ordered isomorph from Planet Linear Chaos, was tasked with finding the minimum and maximum values in an array. As you may remember (or not), the only thing that people on this planet do is sort and compare. Alex was able to do it. Can you?
Comments(14)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Alexandru OvcinicovLevel 15 , London
25 September, 00:10
Thanks for repeating those tasks on this LVL, so i could really get much better !!!
Jonathan FellerLevel 17 , Munich
18 September, 13:50
weak bullshit tasks this time, 10 times the same, pretty disappointing as startup to a new quest
Harvey RobertsLevel 15 , Helsinki
31 August, 04:56
Why does House inherit Asset? I would have thought that an house was a necessity, and a car was an asset.
Noam GLevel 14 , Tel Aviv
21 September, 20:32
Inheritance describes an "is-a" relationship. house is a.. Asset.
Renat MukhametshinLevel 13 , Pervouralsk
29 August, 11:59
ok, good tasks for reinforce basics of inheritance
Boris the LlamaLevel 18 , Maidstone
7 July, 14:56
Very informal greetings from Captain Squirrels and Amigo
EwertonLevel 30 , Belo Horizonte
29 June, 16:42
I think you could reduce or change some tasks here.
Fa YuLevel 16 , Tashkent
25 June, 08:36
too many easy and almost same tasks on inheritance
Bert DoeLevel 18 , Flanders
21 April, 12:05
sw33t, m0v1ng on
// Java PoserLevel 18 , Cincinnati
8 April, 13:11
lol idk wtf I did on the last one but got dammit it worked! (: Marching on to level 12, dev job here i come!
Darko JakimovskiLevel 18 , Kriva Palanka
24 April, 10:40
I always use Collections when in need to sort whatever :D
qwpoLevel 22
22 May, 11:25
Have tried with Collections min and max, but somehow it didn't work. Had to use the classical way. :)
Kron1KLevel 26 , AUS
11 June, 22:11
look into the util.Arrays class
HashiramaLevel 26 , Port-Harcourt
3 February, 16:16
Finally, a class with parameters. The last task on this list is exquisite!!! I can't help but be excited!!!