Inheritance

I'm doing a lesson that is supposed to demonstrate inheritance using the song Old MacDonald; there's an animal interface, a farm class that implements each animal object.. you get the idea. I've got two problems.
First,
The animal has a type and a sound, for example, a chick is

I'm supposed to create a second constructor with a flag that says whether a chick is childish and returns the sound "cheep" or is adult and returns "cluck" so that there's an equal change of getSound() returning either. I have no idea how to do this. I considered adding a boolean to the constructor, but that won't work because the farm class can only create a new Chick(); I realize you're not just going to hand me an answer, but I don't even know where to start.

The other issue is that I'm supposed to create a NamedCow class that, as you probably guessed, gives the cow a name. I'm supposed to be able to add a named cow to an arraylist by typing

myFarm.add(new Cow("Elsie"));

. I can't just add a getName method to the cow class, namedCow has to be a new class. I figure okay, simple,

Why can't the farm class create a new Chick object with the syntax Chick(true) or Chick(false) depending on if it is young or old? And you can also add a randomizer if you wanted to, and add isYoung() and isOld() methods. And why can't you add that method to the Cow class? Also, why is Animal an interface -- a Chick should extend Animal, because a Chick is-a Animal. But can you post your complete code? I think it would clarify your questions. Because several suggestions you point out you say you can't do either b/c the Farm class won't allow it (which you didn't show us) or that you can't add a name to a Cow but i don't see why not. If you post your full code it should help us to see exactly what's going wrong.

lab: http://tinyurl.com/2g24jk9
As you can see, I'm given a set farm class, a set animal interface, and I need to make cow and chick do the above actions. I can't add to cow because the lab requires that I create a NamedCow class so that i have to implement a class that extends another, and I can't use a boolean because I'm givena final farm class. Thank you for your patience.
My complete code:

public interface Animal{
public String getSound();
public String getType();
}

Hey. I guess I am a little late, but I had the same assignment and same problem, and I am sure people after me will too.
So, I couldn't figure out how to do the NamedCow part. But you dont have to. Just overload the constructor in Cow.java like this:

Hi. so this is actually a continuation from another question of mine[Here](https://www.daniweb.com/programming/software-development/threads/506795/dynamically-add-values-into-datagridview-cell-from-listbox-vb2010) but i was advised to start a new thread as the original question …

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...