forked from abdu8220/CISC230
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Animal.java
146 lines (129 loc) · 3.5 KB
/
Animal.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/**
* This is the class to be extended
* @author Johnathan Marin-Romero
* @version 1.0
* @since 4/26/16
*/
public class Animal
{
/**
*I don't really know what this is
*/
public String Conservation_status;
public String getCon(){return Conservation_status; }
/**
* A string to say what this animal eats
*/
public String Diet;
public String getDiet(){ return Diet; }
/**
* {@code true} for this animal can fly
* {@code false} for this animal cannot fly
*/
public boolean Flight;
public boolean getFlight(){ return Flight; }
/**
* String for the place where the animal lives ex: {@code "Pacific Ocean"}
*/
public String Habit;
public String getHabit(){ return Habit; }
/**
* {@code true} for this animal is healthy
* {@code false} for this animal is not healthy
*/
public boolean Healthy;
public boolean getHealth(){ return Healthy; }
/**
* Height in inches
*/
public int Height;
public int getHieght(){ return Height; }
/**
* String format for the date of the animal's last checkup {@code "MM/DD/YY"}
*/
public String Last_Checkup;
public String getLastC(){ return Last_Checkup; }
/**
*Length in inches
*/
public int Length;
public int getLength(){ return Length; }
/**
*lifespan in years
*/
public int Lifespan;
public int getLife(){ return Lifespan; }
/**
* String for where the animal is located in the zoo
*/
public String Location;
public String getLoc(){ return Location; }
/**
* String for the species name ex: {@code "cat"}
*/
public String Name;
public String getName(){ return Name; }
/**
* Weight in pounds
*/
public int Weight;
public int getWeight(){ return Weight; }
/**
* Animal class constructor
*/
public Animal(String Consevervation_status, String Diet, boolean Flight, String Habit, boolean heathly, int height, String Last_Checkup, int Length, int Lifespan, String Location, String Name, int Weight){
this.Conservation_status = Consevervation_status;
this.Diet = Diet;
this.Flight = Flight;
this.Habit = Habit;
this.Healthy = heathly;
this.Height = height;
this.Last_Checkup = Last_Checkup;
this.Length = Length;
this.Lifespan = Lifespan;
this.Location = Location;
this.Name = Name;
this.Weight = Weight;
}
/**
* Zoo keeper sends the animal to have a check up
*/
public void CheckUp() {
// TODO implement me
}
/**
* Zoo keeper feeds the animal
*/
public void Feed() {
// TODO implement me
}
/**
* Move moves the animal to a new location on the zoo
* @param newLoc is a string for where the animal is going to be moved to
* @return A string to where the animal was moved to
*/
public String Move(String newLoc) {
Location = newLoc;
return getLoc();
}
/**
* @return A neat display of all the Animal object's information
*/
@Override
public String toString(){
String temp = "Infomation for ";
temp += getName() + " " + this.getClass().getName() + "\n";
temp += "Conservation Satus" + getCon() + "\n";
temp += "Diet: " + getDiet() + "\n";
temp += "Can it fly? " + ((getFlight()) ? "Yes" : "no") + "\n";
temp += "Natural Habit: " + getHabit() + "\n";
temp += "Is it Healthy? " + ((getHealth()) ? "Yes" : "no") + "\n";
temp += "Hieght in inches: " + getHieght() + "\n";
temp += "Last check up was on: " + getLastC() + "\n";
temp += "Length in inches: " + getLength() + "\n";
temp += "Average Lifespan in years: " + getLife() + "\n";
temp += "Location in Zoo: " + getLoc() + "\n";
temp += "Weight in pounds: " + getWeight() + "\n";
return temp;
}
}