Skip to content

Commit

Permalink
add files for zoo task
Browse files Browse the repository at this point in the history
add link to task (readme)
  • Loading branch information
cagix committed Apr 3, 2024
1 parent 18d8137 commit ac56dfa
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 46 deletions.
53 changes: 7 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,19 @@
---
title: Student Support Code Template
title: "Student Support Code for 'Zoo' Task"
---

<!-- pandoc -s -f markdown -t markdown --columns=94 --reference-links=true README.md -->

## About

This is a template repo for providing student support code (e.g. source code and tests) for
Java based homework assignments.

It comes with batteries included:

- [Gradle 8.6] preinstalled
- Basic Gradle configuration:
- [JDK 21] based projects
- Default [Gradle Java project layout]
- [JUnit 5] for software testing
- [Checkstyle] to check for valid Javadoc comments for all `public` elements in source
code
- [Spotless] to check formatting of Java code using the [Google Java Style Guide], can
also format sources if necessary
- [GitHub workflow] to build and test the project in [GitHub CI], check sources with
Checkstyle and Spotless
- [Dependabot] to keep dependencies (GitHub workflow, Gradle configuration) up to date

## Usage

This repo is intended to be used as a template repo. To create new repos for assignments, the
following steps may help:

1. Fork this repo or use it as a template to create a new repo.
2. Add the required source code, tests and task descriptions to your new repo.
3. If needed, adjust the Gradle configuration to your needs.
4. Make your new repo available to the students.

If desired, activate the GitHub CI in your new repo (under "*Settings \> Actions \> General \>
Allow actions*"). You need to allow at least the following actions: `actions/checkout@v4` and
`actions/setup-java@v4`.
This represents the student support code for the [Zoo task].

## License

This [work] by [Carsten Gips] and [contributors] is licensed under [MIT].

[Gradle 8.6]: https://docs.gradle.org/8.6/release-notes.html
[JDK 21]: https://jdk.java.net/21/
[Gradle Java project layout]: https://docs.gradle.org/current/userguide/java_plugin.html#sec:java_project_layout
[JUnit 5]: https://junit.org/junit5/
[Checkstyle]: https://github.com/checkstyle/checkstyle
[Spotless]: https://github.com/diffplug/spotless
[Google Java Style Guide]: https://google.github.io/styleguide/javaguide.html
[GitHub workflow]: https://docs.github.com/en/get-started/using-github/github-flow
[GitHub CI]: https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration
[Dependabot]: https://docs.github.com/en/code-security/dependabot/working-with-dependabot
[work]: https://github.com/Programmiermethoden-CampusMinden/student-support-code-template
[Carsten Gips]: https://github.com/cagix
[contributors]: https://github.com/Programmiermethoden-CampusMinden/student-support-code-template/graphs/contributors
[MIT]: LICENSE.md
[Zoo task]: https://github.com/Programmiermethoden-CampusMinden/Prog2-Lecture/blob/master/homework/b02.md
[work]: https://github.com/Programmiermethoden-CampusMinden/prog2_ybel_zoo
[Carsten Gips]: https://github.com/cagix
[contributors]: https://github.com/Programmiermethoden-CampusMinden/prog2_ybel_zoo/graphs/contributors
[MIT]: LICENSE.md
14 changes: 14 additions & 0 deletions src/main/java/zoo/Animal.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package zoo;

/** Describes the shared features of every animal. */
public interface Animal {
/**
* Every creature has a name.
*
* @return the name of the animal
*/
String getName();

/** Creatures can move around. */
void move();
}
11 changes: 11 additions & 0 deletions src/main/java/zoo/fishes/Fish.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package zoo.fishes;

import zoo.Animal;

/** Fish form an animal class. */
public interface Fish extends Animal {
/** Our fish can swim by using the move method. */
default void swim() {
move();
}
}
11 changes: 11 additions & 0 deletions src/main/java/zoo/mammals/Mammal.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package zoo.mammals;

import zoo.Animal;

/** Mammals form an animal class. */
public interface Mammal extends Animal {
/** Our mammals can run around by using the move method. */
default void run() {
move();
}
}
6 changes: 6 additions & 0 deletions src/main/java/zoo/mammals/cats/Cat.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package zoo.mammals.cats;

import zoo.mammals.Mammal;

/** The cat family belongs to the class of mammals. */
public interface Cat extends Mammal {}
6 changes: 6 additions & 0 deletions src/main/java/zoo/mammals/primates/Primate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package zoo.mammals.primates;

import zoo.mammals.Mammal;

/** The order of primates belongs to the class of mammals. */
public interface Primate extends Mammal {}
6 changes: 6 additions & 0 deletions src/main/java/zoo/mammals/rodents/Rodent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package zoo.mammals.rodents;

import zoo.mammals.Mammal;

/** The order of rodents belongs to the class of mammals. */
public interface Rodent extends Mammal {}
11 changes: 11 additions & 0 deletions src/main/java/zoo/reptiles/Reptile.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package zoo.reptiles;

import zoo.Animal;

/** Reptiles form an animal class. */
public interface Reptile extends Animal {
/** Our reptiles can crawl by using the move method. */
default void crawl() {
move();
}
}
Empty file removed src/test/java/.gitkeep
Empty file.

0 comments on commit ac56dfa

Please sign in to comment.