Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
COM4005M_Khan_MuhammadAffanHabib
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
affan.khan
COM4005M_Khan_MuhammadAffanHabib
Commits
85742d3e
Commit
85742d3e
authored
Apr 19, 2021
by
affankhan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit #1
parents
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
239 additions
and
0 deletions
+239
-0
.classpath
Virtual Zoo Affan Khan/.classpath
+6
-0
.gitignore
Virtual Zoo Affan Khan/.gitignore
+1
-0
.project
Virtual Zoo Affan Khan/.project
+17
-0
Animals.java
Virtual Zoo Affan Khan/src/Animals.java
+61
-0
Birds.java
Virtual Zoo Affan Khan/src/Birds.java
+38
-0
Fish.java
Virtual Zoo Affan Khan/src/Fish.java
+38
-0
Main.java
Virtual Zoo Affan Khan/src/Main.java
+0
-0
Mammals.java
Virtual Zoo Affan Khan/src/Mammals.java
+39
-0
Reptiles.java
Virtual Zoo Affan Khan/src/Reptiles.java
+39
-0
No files found.
Virtual Zoo Affan Khan/.classpath
0 → 100644
View file @
85742d3e
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry
kind=
"src"
path=
"src"
/>
<classpathentry
kind=
"con"
path=
"org.eclipse.jdt.launching.JRE_CONTAINER"
/>
<classpathentry
kind=
"output"
path=
"bin"
/>
</classpath>
Virtual Zoo Affan Khan/.gitignore
0 → 100644
View file @
85742d3e
/bin/
Virtual Zoo Affan Khan/.project
0 → 100644
View file @
85742d3e
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>
Virtual Zoo Affan Khan
</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>
org.eclipse.jdt.core.javabuilder
</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>
org.eclipse.jdt.core.javanature
</nature>
</natures>
</projectDescription>
Virtual Zoo Affan Khan/src/Animals.java
0 → 100644
View file @
85742d3e
public
class
Animals
{
//establish the member variables
String
name
;
String
scientificName
;
String
diet
;
String
habitat
;
String
physicalCharacteristics
;
//create the constructor
Animals
(
String
name
,
String
scientificName
,
String
diet
,
String
habitat
,
String
physicalCharacteristics
)
{
this
.
name
=
name
;
this
.
scientificName
=
scientificName
;
this
.
diet
=
diet
;
this
.
habitat
=
habitat
;
this
.
physicalCharacteristics
=
physicalCharacteristics
;
}
//end of the constructor
//create the print name method
void
printName
()
{
System
.
out
.
println
(
"Animal Name: "
+
name
);
}
//end of the print name method
//create the print details method
void
printDetails
()
{
System
.
out
.
println
(
"Animal Name: "
+
name
);
System
.
out
.
println
(
"Scientific Name: "
+
scientificName
);
System
.
out
.
println
(
"Diet: "
+
diet
);
System
.
out
.
println
(
"Habitat: "
+
habitat
);
System
.
out
.
println
(
"Physical Characteristics: "
+
physicalCharacteristics
);
}
//end of the print details method
//create the print habitat method
void
printHabitat
()
{
System
.
out
.
println
(
name
+
"'s Habitat: "
+
habitat
);
}
//end of print habitat method
//create a method that prints the diet of the animal
void
printDiet
()
{
//create the if statement for when the animal is a carnivore
if
(
diet
==
"Carnivores"
)
{
System
.
out
.
println
(
name
+
"'s Diet: Meat"
);
}
//end of the carnivore if statement
//create the if statement for when the animal is a herbivore
if
(
diet
==
"Herbivores"
)
{
System
.
out
.
println
(
name
+
"'s Diet: Plants"
);
}
//end of the herbivore if statement
//create the if statement for when the animal is a omnivore
if
(
diet
==
"Omnivores"
)
{
System
.
out
.
println
(
name
+
"'s Diet: Meat and Plants"
);
}
//end of the omnivore if statement
}
}
Virtual Zoo Affan Khan/src/Birds.java
0 → 100644
View file @
85742d3e
public
class
Birds
extends
Animals
{
String
birdFeature
=
"Have Feathers"
;
String
birdFeature2
=
"Lay Hard Shelled Eggs"
;
String
birdFeature3
=
"Toothless Beaked Jaws"
;
//create the constructor
Birds
(
String
name
,
String
scientificName
,
String
diet
,
String
habitat
,
String
physicalCharacteristics
)
{
super
(
name
,
scientificName
,
diet
,
habitat
,
physicalCharacteristics
);
}
//end of the constructor
//create the print name method
void
printName
()
{
super
.
printName
();
}
//end of print name method
//create the print details method
void
printDetails
()
{
super
.
printDetails
();
System
.
out
.
println
(
"Features of Birds: "
+
birdFeature
);
System
.
out
.
println
(
" "
+
birdFeature2
);
System
.
out
.
println
(
" "
+
birdFeature3
);
System
.
out
.
println
(
"______________________________________________________________________________"
);
}
//end of print details
//create the print habitat method
void
printHabitat
()
{
super
.
printHabitat
();
}
//end of print habitat method
//create the print diet method
void
printDiet
()
{
super
.
printDiet
();
}
//end of the print diet
}
Virtual Zoo Affan Khan/src/Fish.java
0 → 100644
View file @
85742d3e
public
class
Fish
extends
Animals
{
//create the unique features variables
String
fishFeature
=
"Use Gills to Breathe"
;
String
fishFeature2
=
"Use Fins for Movement"
;
String
fishFeature3
=
"Thrive in Water"
;
//create the constructor
Fish
(
String
name
,
String
scientificName
,
String
diet
,
String
habitat
,
String
physicalCharacteristics
)
{
super
(
name
,
scientificName
,
diet
,
habitat
,
physicalCharacteristics
);
}
//end of the constructor
//create the print name method
void
printName
()
{
super
.
printName
();
}
//end of print name method
//create the print details method
void
printDetails
()
{
super
.
printDetails
();
System
.
out
.
println
(
"UniqueFeatures: "
+
fishFeature
);
System
.
out
.
println
(
" "
+
fishFeature2
);
System
.
out
.
println
(
" "
+
fishFeature3
);
System
.
out
.
println
(
"______________________________________________________________________________"
);
}
//end of print details
//create the print habitat method
void
printHabitat
()
{
super
.
printHabitat
();
}
//end of print habitat method
//create the print diet method
void
printDiet
()
{
super
.
printDiet
();
}
//end of the print diet
}
Virtual Zoo Affan Khan/src/Main.java
0 → 100644
View file @
85742d3e
This diff is collapsed.
Click to expand it.
Virtual Zoo Affan Khan/src/Mammals.java
0 → 100644
View file @
85742d3e
public
class
Mammals
extends
Animals
{
String
mammalFeature
=
"Contain Mammary Glands"
;
String
mammalFeature2
=
"Female Produce Milk"
;
String
mammalFeature3
=
"Contain Fur or Hair"
;
//create the constructor
Mammals
(
String
name
,
String
scientificName
,
String
diet
,
String
habitat
,
String
physicalCharacteristics
)
{
super
(
name
,
scientificName
,
diet
,
habitat
,
physicalCharacteristics
);
}
//end of the constructor
//create the print name method
void
printName
()
{
super
.
printName
();
}
//end of print name method
//create the print details method
void
printDetails
()
{
super
.
printDetails
();
System
.
out
.
println
(
"Features of Mammals: "
+
mammalFeature
);
System
.
out
.
println
(
" "
+
mammalFeature2
);
System
.
out
.
println
(
" "
+
mammalFeature3
);
System
.
out
.
println
(
"______________________________________________________________________________"
);
}
//end of print details
//create the print habitat method
void
printHabitat
()
{
super
.
printHabitat
();
}
//end of print habitat method
//create the print diet method
void
printDiet
()
{
super
.
printDiet
();
}
//end of the print diet
}
Virtual Zoo Affan Khan/src/Reptiles.java
0 → 100644
View file @
85742d3e
public
class
Reptiles
extends
Animals
{
//create the unique features variables
String
reptileFeature
=
"Bodies are Covered in Scales"
;
String
reptileFeature2
=
"Ferilize Eggs Internally"
;
String
reptileFeature3
=
"Consist of Atleast One Lung"
;
//create the constructor
Reptiles
(
String
name
,
String
scientificName
,
String
diet
,
String
habitat
,
String
physicalCharacteristics
)
{
super
(
name
,
scientificName
,
diet
,
habitat
,
physicalCharacteristics
);
}
//end of the constructor
//create the print name method
void
printName
()
{
super
.
printName
();
}
//end of print name method
//create the print details method
void
printDetails
()
{
super
.
printDetails
();
System
.
out
.
println
(
"UniqueFeatures: "
+
reptileFeature
);
System
.
out
.
println
(
" "
+
reptileFeature2
);
System
.
out
.
println
(
" "
+
reptileFeature3
);
System
.
out
.
println
(
"______________________________________________________________________________"
);
}
//end of print details
//create the print habitat method
void
printHabitat
()
{
super
.
printHabitat
();
}
//end of print habitat method
//create the print diet method
void
printDiet
()
{
super
.
printDiet
();
}
//end of the print diet
}
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