-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathAnimalNoises.java
More file actions
27 lines (22 loc) · 918 Bytes
/
AnimalNoises.java
File metadata and controls
27 lines (22 loc) · 918 Bytes
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
//added semicolon to the end of import (Andrew Steele 01/10/2023)
import model.*;
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());
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());
Siamang monk = new Siamang();
System.out.println(monk.makeNoise());
Shark Stewy = new Shark();
System.out.println(Stewy.makeNoise());
}
}