FontysICT-sem1

Challenge Duck Pond

If you already know how to program with objects you can demonstrate this demonstrate this by creating the attached challenge and discussing it with your teacher discuss.

Hint

It is all about the concepts! Whether it looks pretty is NOT IMPORTANT to show whether you can program! What is important is whether you use classes, encapsulation, …

Challenge Duck Pond

Create a project called DucksPondVan with your own name behind it. In that pond there are 26 ducks. A duck can be a female or male: This is determined when you create the ‘‘object’’ for that duck, so you create a constructor with the parameter of whether it’s a female or male. Furthermore, I can ask a duck (choose how) whether it is male or female.

The pond contains frogs. Objects are also created for these.

Create a class Stork. The stork gets a method called EatFrog, with at least the frog being eaten as a parameter. Somewhere in your program you have to call this method.

What does the app need to satisfy?

Add things to make it logical. Don’t be satisfied too quickly, if you want to show that you are a master of OOP, you can make this an elaborate program!

Discuss your solution with your teacher: write down the feedback! Discuss with the teacher what you can best concentrate on.

Some ideas:

Make up your own features.