Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AssessmentZooProgram
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
a-j.towse
AssessmentZooProgram
Commits
3dd4a863
Commit
3dd4a863
authored
May 14, 2022
by
a-j.towse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working version with DisplayAnimalFoodList
parent
bec6856b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
2 deletions
+12
-2
App.class
ZooProgram/bin/App.class
+0
-0
Zoo.class
ZooProgram/bin/Zoo.class
+0
-0
App.java
ZooProgram/src/App.java
+6
-2
Zoo.java
ZooProgram/src/Zoo.java
+6
-0
No files found.
ZooProgram/bin/App.class
View file @
3dd4a863
No preview for this file type
ZooProgram/bin/Zoo.class
View file @
3dd4a863
No preview for this file type
ZooProgram/src/App.java
View file @
3dd4a863
import
java.util.ArrayList
;
public
class
App
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
...
...
@@ -17,8 +19,10 @@ public class App {
myZoo
.
displayfoodRequirements
(
Rex
);
myZoo
.
displayfoodRequirements
(
Pix
);
ArrayList
<
Animal
>
animalFoodReqList
=
new
ArrayList
<>();
animalFoodReqList
.
add
(
Rex
);
animalFoodReqList
.
add
(
Pix
);
myZoo
.
displayfoodListRequirements
(
animalFoodReqList
);
}
...
...
ZooProgram/src/Zoo.java
View file @
3dd4a863
...
...
@@ -21,6 +21,12 @@ public class Zoo {
System
.
out
.
println
(
animal
.
getFoodType
());
}
public
void
displayfoodListRequirements
(
ArrayList
<
Animal
>
animalList
){
for
(
int
i
=
0
;
i
<
animalList
.
size
();
i
++){
System
.
out
.
println
(
animalList
.
get
(
i
).
getFoodType
());
}
}
public
void
displayDetails
(
Animal
animal
){
ArrayList
<
String
>
detailList
=
animal
.
getDetails
();
for
(
int
i
=
0
;
i
<
detailList
.
size
();
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