-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathAnimalNoises.java
More file actions
127 lines (85 loc) · 3.45 KB
/
AnimalNoises.java
File metadata and controls
127 lines (85 loc) · 3.45 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
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
//added semicolon to the end of import (Andrew Steele 01/10/2023)
//had to add semicolon to the end of import model.Example for program to run (Riley Ahlrichs 1/14/2023)
import model.Example;
import model.Lion;
import model.PolarBear;
import model.Siamang;
import model.Sloth;
import model.Platypus;
import model.Tiger;
import model.Dog;
import model.Elephant;
import model.Monkey;
import model.Example;
import model.Example;
import model.Example;
import model.Squirrel;
import model.Bird;
import model.Cat;
import model.Penguin;
import model.Wolf;
import model.Cow;
import model.Pig;
import model.Fox;
public class AnimalNoises {
// add your animal class to the model package
// only push this file and the animal class you created
public static void main(String[] args) {
Example example = new Example();
System.out.println(example.makeNoise());
//created a new instance of the object and output the sound it makes
Platypus frank = new Platypus();
System.out.println(frank.makeNoise());
Dog Titan = new Dog();
System.out.println(Titan.makeNoise());
Lion chad = new Lion();
System.out.println(chad.makeNoise());
Bird SomeBirdName = new Bird();
System.out.println(SomeBirdName.makeNoise());
Dog Jerry = new Dog();
System.out.println(Jerry.makeNoise());
Monkey Jeremmy = new Monkey();
System.out.println(Jeremmy.makeNoise());
Cat jordan = new Cat("Jordan",6,true);
System.out.println(jordan.getName() + " Age: " + jordan.getAge() + " Is Loved: " + jordan.getIsLoved());
System.out.println(jordan.getName() + ": " + jordan.speak());
Squirrel squirrel = new Squirrel();
System.out.println(squirrel.makeNoise());
Tiger Machli = new Tiger("Machli",250,5);
System.out.println(Machli.getName() + ": " + Machli.speak());
Wolf Seth = new Wolf("Seth", "Blue", 34);
System.out.println("Name: " + Seth.getName() + "; Eye Color: " + Seth.getEyeColor() + "; Size/Height(in inches): " + Seth.getSize());
System.out.println(Seth.toString());
System.out.println(Seth.speak());
PolarBear polly = new PolarBear("Artic", "Polly", 10);
System.out.println(polly.toString());
System.out.println(polly.speak());
Pig Wilbur = new Pig();
System.out.println(Wilbur.makeNoise());
Penguin bob = new Penguin();
System.out.println(bob.speak());
Pig Pinky = new Pig();
System.out.println(Pinky.makeNoise());
// use non-default constructor Cow(String name, String type, int age, boolean breedStock)
// to create an instance/object of Cow class
Cow betsy = new Cow("Betsy", "dairy", 3, true);
// call speak() method from Cow class to output sound it makes
System.out.println(betsy.speak());
//Abby Boggs 1.13.23 - added wolf instance and noise
Wolf redd = new Wolf("Redd", "forest", "red");
System.out.println(redd.makeNoise());
Fox fantasticMr = new Fox();
System.out.println("Fastastic Mr Fox says: " + fantasticMr.makeNoise());
//Rosie the Elephant
Elephant rosie = new Elephant();
System.out.println("The elephant says \"" + rosie.speak());
Siamang monk = new Siamang();
System.out.println(monk.makeNoise());
//added by Alex Cox - Spring 23
System.out.println(); //aesthetic spacers
Sloth Sid = new Sloth("Sid", 5 , 3, "Maned Sloth");
System.out.println(Sid.getName() + " is a " + Sid.getAge() + " year old " + Sid.getToes() + " toed " + Sid.getSpecies());
System.out.println(Sid.getName() + " makes an " + Sid.speak() + " sound.");
System.out.println(); //aesthetic spacers
}
}