-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathPenguin.java
More file actions
85 lines (71 loc) · 1.54 KB
/
Penguin.java
File metadata and controls
85 lines (71 loc) · 1.54 KB
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
/**
* Author: Hong Huynh - hmhuynh1@dmacc.edu
* CIS 175 - FALL 2023
* Sep 1, 2023
*/
package model;
public class Penguin {
private String type; //type of penguin-ex.king penguin
private String gender; //male, female, intersex
private int age; //age of penguin.
//Default constructor:
public Penguin() {
super();
}
/**
* @param lifeStage
* @param gender
* @param weight
*/
public Penguin (String type, String gender, int age) {
super();
this.type = type;
this.gender = gender;
this.age = age;
}
/**
* @return the lifeStage
*/
public String getType() {
return type;
}
/**
* @param lifeStage the lifeStage to set
*/
public void setType(String type) {
this.type = type;
}
/**
* @return the gender
*/
public String getGender() {
return gender;
}
/**
* @param gender the gender to set
*/
public void setGender(String gender) {
this.gender = gender;
}
/**
* @return the weight
*/
public int getAge() {
return age;
}
/**
* @param weight the weight to set
*/
public void setAge(int age) {
this.age = age;
}
// Overrides toString method to return a string representation of the pen object
@Override
public String toString() {
return "Penguin [gender= " + gender + ", type = " + type + ", Age=" + age + "years old. ]";
}
// Method to return the noise made by the Lion
public String makeNoise() {
return "squawk";
}
}