Question: Please use Java, Thank you. 8-1 Create a class to represent an object of type Animal using the description provided below in UML Animal -

Please use Java, Thank you. 8-1
 Please use Java, Thank you. 8-1 Create a class to represent

Create a class to represent an object of type Animal using the description provided below in UML Animal - name : String - birthYear : int - weight : double - gender : char + Animal() I/ Set name =n, birthYear=1900, weight =0.0, gender='u' + Animal(String, int, double, char) + getName(): String + setName(String) : void + getBirthYear() : int + setBirthYear(int) : void + getWeight() : double + setWeight(double): void lif input value is negative, set weight to 1 + getGender() : char + setGender(char): void // if input value is not ' m ' or ' f ', set gender to ' u ' (unknown) + calculateAge(int) : int // use birthYear and the argument of currentYear to calculate age. + isMale () : boolean I/ If currentYear

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!