{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Rhino_Solutions

Rhino_Solutions - public class Rhino Name of Rhino private...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 public class Rhino { /** Name of Rhino */ private String name /** Gender of Rhino, 'M' for male and'F' for female */ private char gender /** Month of birth of Rhino */ private int MOB /** Year of birth of Rhino */ private int YOB /** Tag number of Rhino or -1 if Rhino is not tagged */ private int tag=-1 /** Name of father of Rhino */ private Rhino father /** Name of mother of Rhino */ private Rhino mother /** Number of children Rhino has */ private int numberOfChildren /** Constructor: a new Rhino. Parameters are, in order, * the name of the rhino, the month and year of birth, and its gender. * The new rhino is not tagged, its parents are not known, and gender is 'F' or 'M'. * It has no children. */ public Rhino(String n, int m, int y, char g) { name= n MOB= m YOB= y gender= g } /** = the name of the Rhino as a string */ public String getName() { return name } /** = the gender of the Rhino ('M' formale, 'F'for female) */ public char getGender() { return gender } /** = the month the Rhino was born in the range 1...12 as an int */ public int getMOB() { return MOB }
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Sheet1 Page 2 /** = the year the Rhino was born as an int */
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern