Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #62

Merged
merged 28 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/documentation/comparators.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Attribut `bar` sortiert.
public class MainClass {

public static void main(String[] args) {
ArrayList<Container> containers = new ArrayList<>();
List<Container> containers = new ArrayList<>();
containers.add(new Container("Winter"));
containers.add(new Container("is"));
containers.add(new Container("Coming"));
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/io-streams.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public class Foo implements Serializable {
public class MainClass {

public static void main(String[] args) {
ArrayList<Foo> foos = new ArrayList<>();
List<Foo> foos = new ArrayList<>();
foos.add(new Foo());
foos.add(new Foo());

Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class MainClass {

public static void main(String[] args) {

HashMap<Integer, String> foos = new HashMap<>();
Map<Integer, String> foos = new HashMap<>();
foos.put(834, "Hans");
foos.put(269, "Peter");
foos.put(771, "Lisa");
Expand Down
16 changes: 8 additions & 8 deletions docs/exam-exercises/exam-exercises-java1/cards-dealer.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ classDiagram
Player o-- Card

class Player {
-cards ArrayList~Card~
+Player(cards ArrayList~Card~)
-cards List~Card~
+Player(cards List~Card~)
+addCard(card Card) void
+getCardWithHighestValue() Card
+getCardsByColour(colour String) ArrayList~Card~
+getCardsByColour(colour String) List~Card~
}

class CardDealer {
-deck ArrayList~Card~
-deck List~Card~
-player1 Player
-player2 Player
+CardsDealer(deck ArrayList~Card~, player1 Player, player2 Player )
+CardsDealer(deck List~Card~, player1 Player, player2 Player )
+dealCards(amount int) void
}

Expand All @@ -37,7 +37,7 @@ classDiagram
}

class CardsReader {
+getCards(file File) ArrayList~Card~
+getCards(file File) List~Card~
}
```

Expand All @@ -49,7 +49,7 @@ classDiagram
## Hinweise zur Klasse Player

- Die Methode `void addCard(card: Card)` soll dem Spieler die eingehende Karte hinzufügen
- Die Methode `ArrayList<Card> getCardsByColour(colour: String)` soll alle Karten des Spielers zur eingehenden Farbe zurückgeben
- Die Methode `List<Card> getCardsByColour(colour: String)` soll alle Karten des Spielers zur eingehenden Farbe zurückgeben
- Die Methode `Card getCardWithHighestValue()` soll die Karte des Spielers mit dem höchsten Wert zurückgeben

## Hinweis zur Klasse CardsDealer
Expand All @@ -58,7 +58,7 @@ Die Methode `void dealCards(amount: int)` soll den beiden Spielern die eingehend

## Hinweis zur Klasse CardsReader

Die Methode `ArrayList<Card> getCards(file: File)` soll alle Karten der eingehenden Datei zurückgeben.
Die Methode `List<Card> getCards(file: File)` soll alle Karten der eingehenden Datei zurückgeben.

## Beispielhafter Aufbau der Kartendatei

Expand Down
31 changes: 11 additions & 20 deletions docs/exam-exercises/exam-exercises-java1/cashier-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Setze das abgebildete Klassendiagramm vollständig um. Erstelle zum Testen eine

```mermaid
classDiagram
Product o-- Currency
Product <|-- Goods
Item o-- Goods
ShoppingCart o-- Item
Expand All @@ -23,37 +22,29 @@ classDiagram
-id int
-description String
-unit String
-price double
-currency Currency
+Product(id int, description String, unit String, price double, currency Currency)
+setPrice(price double) void
+setCurrency(currency Currency) void
}

class Currency {
<<enumeration>>
EURO
DOLLAR
-priceInEuro double
+Product(id int, description String, unit String, priceInEuro double)
+setPriceInEuro(priceInEuro double) void
}

class Goods {
-classOfGoods ClassOfGoods
+Goods(id int, description String, unit String, price double, currency Currency, classOfGoods ClassOfGoods)
+Goods(id int, description String, unit String, priceInEuro double, classOfGoods ClassOfGoods)
}

class Item {
-goods Goods
-amount int
+Item(goods Goods, amount int)
+setAmount(amount int) void
+getSubTotal() double
+getSubTotalInEuro() double
}

class ShoppingCart {
-items ArrayList~Item~
-items List~Item~
+ShoppingCart()
+createItem(goods Goods, amount int) void
+getTotal() double
+getTotalInEuro() double
}

class ClassOfGoods {
Expand All @@ -66,8 +57,8 @@ classDiagram

class CashierSystem {
-name String
-goods ArrayList~Goods~
-cashiers ArrayList~Cashier~
-goods List~Goods~
-cashiers List~Cashier~
-shoppingCart ShoppingCart
-cashier Cashier
+CashierSystem(name String)
Expand All @@ -93,12 +84,12 @@ classDiagram

## Hinweis zur Klasse Item

Die Methode `double getSubTotal()` soll die Zwischensumme gemäß der Formel _Anzahl \* Preis_ zurückgeben
Die Methode `double getSubTotalInEuro()` soll die Zwischensumme gemäß der Formel _Anzahl \* Preis_ zurückgeben

## Hinweise zur Klasse ShoppingCart

- Die Methode `void createItem(goods: Goods, amount: int)` soll den Einträgen des Warenkorbs (`items`) die eingehende Ware und die eingehende Anzahl als Eintrag hinzufügen
- Die Methode `double getTotal()` soll die Gesamtsumme zurückgeben
- Die Methode `double getTotalInEuro()` soll die Gesamtsumme zurückgeben

## Hinweise zur Klasse CashierSystem

Expand Down
10 changes: 5 additions & 5 deletions docs/exam-exercises/exam-exercises-java1/christmas-tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ classDiagram

class ChristmasTree {
-type String
-size double
-candles ArrayList~Candle~
+ChristmasTree(type String, size double)
-sizeInM double
-candles List~Candle~
+ChristmasTree(type String, sizeInM double)
+addCandle(candle Candle) void
+lightChristmasTree() void
+getNumberOfElectricCandles() int
Expand All @@ -33,7 +33,7 @@ classDiagram
}

class ElectricCandle {
-power int
-powerInPercent int
+ElectricCandle(colour String)
+lightACandle() void
+recharge() void
Expand All @@ -58,6 +58,6 @@ classDiagram

## Hinweise zur Klasse ElectricCandle

- Der Konstruktor soll die Energie (`power`) auf den Wert _100_ setzen
- Der Konstruktor soll die Energie (`powerInPercent`) auf den Wert _100_ setzen
- Die Methode `void lightACandle()` soll die elektrische Kerze "entzünden", wenn diese noch über Energie verfügt und die Energie um den Wert _10_ reduzieren
- Die Methode `void recharge()` soll die Energie der elektrische Kerze wieder auf den Wert _100_ setzen
16 changes: 8 additions & 8 deletions docs/exam-exercises/exam-exercises-java1/cookie-jar.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ classDiagram
Recipe o-- Ingredient

class CookieJar {
-cookies ArrayList~Cookie~
-cookies List~Cookie~
+CookieJar()
+addCookie(cookie Cookie) void
+getStuffedCookie() StuffedCookie
Expand All @@ -28,18 +28,18 @@ classDiagram
-name String
-dough Recipe
+Cookie(name String, dough Recipe)
+getIngredients() ArrayList~Ingredient~
+getIngredients() List~Ingredient~
}

class StuffedCookie {
-jam Recipe
+StuffedCookie(name String, dough Recipe, jam Recipe)
+getIngredients() ArrayList~Ingredient~
+getIngredients() List~Ingredient~
}

class Recipe {
-name String
-ingredients ArrayList~Ingredient~
-ingredients List~Ingredient~
+Recipe(name String)
+addIngredient(ingredient Ingredient) void
}
Expand All @@ -50,7 +50,7 @@ classDiagram
}

class IngredientsReader {
+readIngredients(file File) ArrayList~Ingredient~
+readIngredients(file File) List~Ingredient~
}
```

Expand All @@ -62,11 +62,11 @@ classDiagram

## Hinweis zur Klasse Cookie

Die Methode `ArrayList<Ingredient> getIngredients()` soll alle Zutaten des Teigs zurückgeben.
Die Methode `List<Ingredient> getIngredients()` soll alle Zutaten des Teigs zurückgeben.

## Hinweis zur Klasse StuffedCookie

Die Methode `ArrayList<Ingredient> getIngredients()` soll alle Zutaten des Teigs sowie der Füllung zurückgeben.
Die Methode `List<Ingredient> getIngredients()` soll alle Zutaten des Teigs sowie der Füllung zurückgeben.

## Hinweis zur Klasse Recipe

Expand All @@ -80,7 +80,7 @@ Die Methode `void addIngredient(ingredient: Ingredient)` soll dem Rezept die ein

## Hinweis zur Klasse IngredientsReader

Die Methode `ArrayList<Ingredient> readIngredients()` soll alle Zutaten der eingehenden Datei auslesen und zurückgeben.
Die Methode `List<Ingredient> readIngredients()` soll alle Zutaten der eingehenden Datei auslesen und zurückgeben.

## Beispielhafter Aufbau der Zutatendatei

Expand Down
4 changes: 2 additions & 2 deletions docs/exam-exercises/exam-exercises-java1/creature.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ classDiagram
}

class CreaturesReader {
+getCreatures(file File) ArrayList~Creature~
+getCreatures(file File) List~Creature~
}
```

Expand All @@ -61,7 +61,7 @@ classDiagram

## Hinweis zur Klasse CreaturesReader

Die Methode `ArrayList<Creature> getCreatures(file: File)` soll alle Kreaturen der eingehenden Datei zurückgeben und die Kreaturen die Bewegungen der eingehenden Datei ausführen lassen.
Die Methode `List<Creature> getCreatures(file: File)` soll alle Kreaturen der eingehenden Datei zurückgeben und die Kreaturen die Bewegungen der eingehenden Datei ausführen lassen.

## Beispielhafter Aufbau der Kreaturendatei

Expand Down
12 changes: 6 additions & 6 deletions docs/exam-exercises/exam-exercises-java1/fast-food.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@ classDiagram
class Food {
-name String
-foodCategory FoodCategory
-calories double
+Food(name String, foodCategory FoodCategory, calories double)
-calorificValueInKcal double
+Food(name String, foodCategory FoodCategory, calorificValueInKcal double)
}

class FastFood {
-isVegetarian boolean
-ratings ArrayList~Integer~
+FastFood(name String, foodCategory FoodCategory, calories double, isVegetarian boolean)
-ratings List~Integer~
+FastFood(name String, foodCategory FoodCategory, calorificValueInKcal double, isVegetarian boolean)
+addRating(rating int) void
+getAverageRating() double
}

class Burger {
+Burger(name String, calories double, isVegetarian boolean)
+Burger(name String, calorificValueInKcal double, isVegetarian boolean)
}

class FastFoodShop {
-name String
-fastFood ArrayList~FastFood~
-fastFood List~FastFood~
+FastFoodShop(name String)
+addFastFood(fastFood FastFood) void
+rateFastFood(fastFood FastFood, rating int) void
Expand Down
6 changes: 3 additions & 3 deletions docs/exam-exercises/exam-exercises-java1/gift-bag.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ classDiagram
Present o-- Person

class GiftBag {
-presents ArrayList~Present~
-presents List~Present~
+GiftBag()
+addPresent(present Present) void
+getMostExpensivePresent() Present
}

class Present {
-description String
-price double
-priceInEuro double
-sender Person
-recipient Person
+Present(description String, price double, sender Person, recipient Person)
+Present(description String, priceInEuro double, sender Person, recipient Person)
}

class Person {
Expand Down
16 changes: 8 additions & 8 deletions docs/exam-exercises/exam-exercises-java1/parking-garage.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@ classDiagram

class ParkingSpot {
-vehicle Vehicle
-length double
-height double
-lengthInM double
-heightInM double
-isForBusesOnly boolean
+ParkingSpot(length double, height double, isForBusesOnly boolean)
+ParkingSpot(lengthInM double, heightInM double, isForBusesOnly boolean)
}

class Vehicle {
-make String
-model String
-length double
-height double
+Vehicle(make String, model String, length double, height double)
-lengthInM double
-heightInM double
+Vehicle(make String, model String, lengthInM double, heightInM double)
}

class Car {
+Car(make String, model String, length double, height double)
+Car(make String, model String, lengthInM double, heightInM double)
}

class Bus {
+Bus(make String, model String, length double, height double)
+Bus(make String, model String, lengthInM double, heightInM double)
}

class ParkingGarage {
Expand Down
Loading
Loading