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
jinny.wilkin
Zoo Application
Commits
72573186
Commit
72573186
authored
May 15, 2022
by
jinny.wilkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oops
parent
3483040d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
97 deletions
+1
-97
Zoo.java
Zoo.java
+1
-97
No files found.
Zoo.java
View file @
72573186
import
java.util.Scanner
;
public
class
Zoo
{
public
Animal
[]
animals
;
public
Object
[]
arr
=
new
Object
[
11
];
public
void
main
(){
}
public
void
createAnimal
(){
Scanner
input
=
new
Scanner
(
System
.
in
);
System
.
out
.
print
(
"What is the new animal: "
);
String
newAnimal
=
input
.
nextLine
();
if
(
newAnimal
.
toLowerCase
()
==
"baboon"
){
createBaboon
();
}
input
.
close
();
}
public
void
createAnimalClass
(){
Scanner
in
=
new
Scanner
(
System
.
in
);
System
.
out
.
print
(
"What kind of habitat do they need: "
);
arr
[
0
]
=
in
.
nextLine
();
System
.
out
.
print
(
"What food do they eat: "
);
arr
[
1
]
=
in
.
nextLine
();
System
.
out
.
print
(
"What is their name: "
);
arr
[
2
]
=
in
.
nextLine
();
System
.
out
.
print
(
"How old are they: "
);
arr
[
3
]
=
in
.
nextLine
();
System
.
out
.
print
(
"What kind of integument do they possess: "
);
arr
[
4
]
=
in
.
nextLine
();
System
.
out
.
print
(
"What is their gender: "
);
arr
[
5
]
=
in
.
nextLine
();
System
.
out
.
print
(
"How many legs do they have: "
);
arr
[
6
]
=
in
.
nextLine
();
System
.
out
.
print
(
"How fast are they: "
);
arr
[
7
]
=
in
.
nextLine
();
in
.
close
();
}
public
void
createMammal
(){
createAnimalClass
();
Scanner
in
=
new
Scanner
(
System
.
in
);
System
.
out
.
print
(
"How tall are they: "
);
arr
[
8
]
=
in
.
nextLine
();
System
.
out
.
print
(
"Are they bipedal or quadrapedal: "
);
arr
[
9
]
=
in
.
nextLine
();
in
.
close
();
}
public
void
createBird
(){
createAnimalClass
();
Scanner
in
=
new
Scanner
(
System
.
in
);
System
.
out
.
print
(
"How wide are their wings: "
);
arr
[
8
]
=
in
.
nextLine
();
System
.
out
.
print
(
"What colour are their feathers: "
);
arr
[
9
]
=
in
.
nextLine
();
in
.
close
();
}
public
void
createFish
(){
createAnimalClass
();
Scanner
in
=
new
Scanner
(
System
.
in
);
System
.
out
.
print
(
"What colour are they: "
);
arr
[
8
]
=
in
.
nextLine
();
System
.
out
.
print
(
"How long are they: "
);
arr
[
9
]
=
in
.
nextLine
();
in
.
close
();
}
public
void
createReptile
(){
createAnimalClass
();
Scanner
in
=
new
Scanner
(
System
.
in
);
System
.
out
.
print
(
"Are they amphibious: "
);
arr
[
8
]
=
in
.
nextLine
();
System
.
out
.
print
(
"How long are they: "
);
arr
[
9
]
=
in
.
nextLine
();
in
.
close
();
}
}
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