Birds and Tweets
September 4th, 2012
Background
Classification of birds was one of Charles Darwin's favorite hobbies. Tweeter, the newly founded social network has hired you to create a database of birds. Tweeter is interested in the sounds birds make, and whether or not they're correlated to the color of their feathers or whether the pitch is determined by the bird's ability to fly.
Requirements
- String for the name of the bird
- boolean determining whether a bird can fly or not
- int for the height of the bird in cm
- double to represent the weight of the bird
- String[] with all the colors of the Bird
- getName() returns a String which represents the name of the Bird
- canFly() returns a boolean indicating whether the Bird can fly or not
- getHeight() returns an int indicating the height of the Bird
- getWeight() returns a double indicating the weight of the Bird in Kg
- printColors() prints out all the colors this Bird can have, output MUST be of the form:
Colors: Blue Red
- getBirdCount() returns an int representing the number of Birds that have been created.
- (String name, int height, double weight, boolean canFly, String ... colors) creates a Bird specifying the name, height, weight, if it can fly or not and an array of Strings which represents the colors of the bird. For this constructor, we're using variadic arguments. Using this constructor would look something like this: new Bird("Penguin", 70, 25.5, false, "Black", "White")
- (String name, int height, double weight, String[] colors) creates a Bird specifying the name, height, weight and an array of Strings which represents the colors of the bird. This constructor assumes that the bird can fly
Name: BirdName Flies: (True or False) Height: X cm Weight: Y Kg Colors: Blue RedAs well as the BirdCount, ie "BirdCount: 5". To compile both files all you have to do is javac the both files, ie javac Bird.java BirdTest.java. We will not grade your driver program.