Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
Zoo Application
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sam.pople
Zoo Application
Commits
1870f54f
Commit
1870f54f
authored
Jun 05, 2022
by
sam.pople
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Submission
parents
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
0 deletions
+80
-0
App.java
Zoo/src/App.java
+80
-0
No files found.
Zoo/src/App.java
0 → 100644
View file @
1870f54f
import
java.util.ArrayList
;
import
java.util.Scanner
;
public
class
App
{
public
static
void
app
(
String
[]
args
)
{
Scanner
sc
=
new
Scanner
(
System
.
in
);
ArrayList
<
Animals
>
Animals
=
new
ArrayList
<
Animals
>();
// Mammals
Animals
Gorilla
=
new
Mammals
(
"Gorilla"
,
"Gorillas are large and strong primates."
,
"Walks"
,
"14:00"
,
"12:00"
);
Gorilla
.
foodType
=
new
Vegetarian
(
"Fruits"
);
Gorilla
.
Environment
=
new
Woodlands
(
"Jungle"
,
"Tropical forest teeming with food and wildlife"
,
"Africa"
,
20
,
30
);
Animals
.
add
(
Gorilla
);
Animals
Lion
=
new
Mammals
(
"Lion"
,
"Lions are large big cats with sharp teeth that form prides"
,
"Roars"
,
"15:00"
,
"11:00"
);
Lion
.
foodType
=
new
Carnivore
(
"Meat (specifically Wildebeasts, Zebras and Antelopes)"
);
Lion
.
Environment
=
new
Savannah
(
"Savanna"
,
"A grassy woodland"
,
"Africa"
,
50
,
50
);
Animals
.
add
(
Lion
);
Animals
Wolf
=
new
Mammals
(
"Wolf"
,
"Wolves are large canines that hunt in packs."
,
"Howls"
,
"16:00"
,
"13:00"
);
Wolf
.
foodType
=
new
Carnivore
(
"Meat (specifically deer, hares and moose"
);
Wolf
.
Environment
=
new
Woodlands
(
"Forest"
,
"A relatively cold, in this case, ecosystem full of trees."
,
"North America"
,
5
,
45
);
Animals
.
add
(
Wolf
);
Animals
Seal
=
new
Mammals
(
"Seal"
,
"Seals are sea mammals that swim in the ocean"
,
"Swims"
,
"11:30"
,
"12:15"
);
Seal
.
foodType
=
new
Carnivore
(
"Fish"
);
Seal
.
Environment
=
new
Marine
(
"Cold Oceans"
,
"Cold costal parts of the sea"
,
"Around the Arctic"
,
0
,
20
);
Animals
.
add
(
Seal
);
Animals
Elephant
=
new
Mammals
(
"Elephant"
,
"Large trunked and tusked mammals"
,
"Swims"
,
"11:30"
,
"12:15"
);
Elephant
.
foodType
=
new
Vegetarian
(
"Shrubs, herbs and fruits"
);
Elephant
.
Environment
=
new
Savannah
(
"Savanna"
,
"Grassy desert lands"
,
"Africa"
,
50
,
50
);
Animals
.
add
(
Elephant
);
// Birds
Animals
Falcon
=
new
Mammals
(
"Falcon"
,
"An incredibly fast bird of prey with a sharp beak and talons"
,
"Swoops down"
,
"14:30"
,
"15:45"
);
Falcon
.
foodType
=
new
Carnivore
(
"Rats"
);
Falcon
.
Environment
=
new
Savannah
(
"Deserts"
,
"Large open spaces for it to hunt"
,
"Australia"
,
65
,
10
);
Animals
.
add
(
Falcon
);
Animals
Owl
=
new
Birds
(
"Owl"
,
"A round, forward looking bird with acute hearing and vision"
,
"Head-rotates"
,
"16:30"
,
"18:00"
);
Owl
.
foodType
=
new
Omnivore
(
"Insects"
);
Owl
.
Environment
=
new
Woodlands
(
"Rocky terrain"
,
"Mountainous area with much open space"
,
"Any country except Antartica"
,
15
,
5
);
Animals
.
add
(
Owl
);
Animals
Blackbird
=
new
Birds
(
"Blackbird"
,
"A glossy, medium sized black bird."
,
"Tweets"
,
"9:30"
,
"8:15"
);
Blackbird
.
foodType
=
new
Omnivore
(
"Berries"
);
Blackbird
.
Environment
=
new
Woodlands
(
"Grassland"
,
"Grassy land with alot of life and space"
,
"Europe, Russia, North Africa"
,
25
,
4
);
Animals
.
add
(
Blackbird
);
// Reptiles
Animals
Crocodile
=
new
Reptiles
(
"Crocodile"
,
"Predatory reptiles with armour and snapping jaws."
,
"Snaps"
,
"13:00"
,
"14:00"
);
Crocodile
.
foodType
=
new
Carnivore
(
"Meat (specifically small mammals and fish)"
);
Crocodile
.
Environment
=
new
Savannah
(
"Savannah Rivers"
,
"Mirky rivers for them to prey"
,
"Africa"
,
50
,
20
);
Animals
.
add
(
Crocodile
);
Animals
Snake
=
new
Reptiles
(
"Snake"
,
"Limbless slithering reptiles with sharp fangs and often venom"
,
"8:45"
,
"11:45"
,
"Slithers"
);
Snake
.
foodType
=
new
Carnivore
(
"Rats"
);
Snake
.
Environment
=
new
Savannah
(
"Desert"
,
"Dry grasslands"
,
"Africa"
,
50
,
10
);
Animals
.
add
(
Snake
);
// Fish
Animals
Shark
=
new
Fish
(
"Shark"
,
"Sharks are long bodied, predatory, marine fish with dorsal fins and sharpteeth"
,
"Swim hunting"
,
"15:30"
,
"11:45"
);
Shark
.
foodType
=
new
Carnivore
(
"Meat (specifically Fish and Seals"
);
Shark
.
Environment
=
new
Marine
(
"Ocean"
,
"Costal and offshore waters where fish and prey are plentiful"
,
"Around United States"
,
18
,
20
);
Animals
.
add
(
Shark
);
Animals
Clownfish
=
new
Fish
(
"Clownfish"
,
"Fish with an orange and white pattern that are immune to h"
,
"Swim hunting"
,
"15:30"
,
"11:45"
);
Clownfish
.
foodType
=
new
Omnivore
(
"Zooplankton"
);
Clownfish
.
Environment
=
new
Marine
(
"Sheltered reefs"
,
"They live in anemones in warm reefs"
,
"Pacific Ocean"
,
24
,
3
);
Animals
.
add
(
Clownfish
);
System
.
out
.
println
(
"Animals: "
);
for
(
int
i
=
0
;
i
<
Animals
.
size
();
i
++)
{
System
.
out
.
println
(
Animals
.
get
(
i
));
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment