diff --git a/src/com/company/OnlineShop/Article.java b/src/com/company/OnlineShop/Article.java new file mode 100644 index 0000000..fd4c021 --- /dev/null +++ b/src/com/company/OnlineShop/Article.java @@ -0,0 +1,17 @@ +package com.company.OnlineShop; + +import java.net.http.WebSocket; + +public class Article { + private int articleNumber; + private double price; + + public Article(int articleNumber, double price){ + this.articleNumber = articleNumber; + this.price= price; + } + + public double getPrice(){ + return this.price; + } +} diff --git a/src/com/company/OnlineShop/Book.java b/src/com/company/OnlineShop/Book.java new file mode 100644 index 0000000..9e202a5 --- /dev/null +++ b/src/com/company/OnlineShop/Book.java @@ -0,0 +1,22 @@ +package com.company.OnlineShop; + +public class Book extends Article{ + + public static double VAT = 0.07; + private String author = ""; + private String title = ""; + private int year = 0; + + public Book(int articleNumber, double price, String author, String title, int year){ + super(articleNumber, price); + this.author = author; + this.title = title; + this.year = year; + } + + + public double getPrice(){ + return super.getPrice() + ( VAT + 1); + } + +} diff --git a/src/com/company/OnlineShop/DVD.java b/src/com/company/OnlineShop/DVD.java new file mode 100644 index 0000000..b4ca036 --- /dev/null +++ b/src/com/company/OnlineShop/DVD.java @@ -0,0 +1,21 @@ +package com.company.OnlineShop; + +public class DVD extends Article { + + public static double VAT = 0.19; + private String Name = ""; + private int Duration= 0; + private int CountryCode = 0; + + public DVD(int articleNumber, double price, String Name, int Duration, int CountryCode){ + super(articleNumber, price); + this.Name = Name; + this.Duration = Duration; + this.CountryCode = CountryCode; + } + + + public double getPrice(){ + return super.getPrice() + ( VAT + 1); + } +} diff --git a/src/com/company/OnlineShop/ShopingCard.java b/src/com/company/OnlineShop/ShopingCard.java new file mode 100644 index 0000000..cc0e94f --- /dev/null +++ b/src/com/company/OnlineShop/ShopingCard.java @@ -0,0 +1,16 @@ +package com.company.OnlineShop; + +public class ShopingCard { + public static void main(String[] args){ + Article article = new Book(10, 34.9997, "WebSockets", "Luigi Lo lacono", 2015); + DVD dvd1 = new DVD(20, 17.7905, "Spiel mir das Lied vom Tod", 1, 1); + DVD dvd2 = new DVD(21, 9.996, "Casablanca", 1, 1); + } + + public void showBill(){ + + + + } + +} diff --git a/src/com/company/audioEffekte/AudioEffectPlayer.java b/src/com/company/audioEffekte/AudioEffectPlayer.java new file mode 100644 index 0000000..27f028e --- /dev/null +++ b/src/com/company/audioEffekte/AudioEffectPlayer.java @@ -0,0 +1,19 @@ +package com.company.audioEffekte; + +public class AudioEffectPlayer { + private String[] audioEffect; + + public void play(int index){ + + + } + public void addEffect(Audioeffekt audioeffekt){ + + + } + public void removeEffect(int index){ + + + } + +} diff --git a/src/com/company/audioEffekte/Audioeffekt.java b/src/com/company/audioEffekte/Audioeffekt.java new file mode 100644 index 0000000..4cba773 --- /dev/null +++ b/src/com/company/audioEffekte/Audioeffekt.java @@ -0,0 +1,14 @@ +package com.company.audioEffekte; + +abstract class Audioeffekt { + + protected String dateiname; + + public Audioeffekt(String dateiname){ + + } + + public void playEffect(){ + + } +} diff --git a/src/com/company/audioEffekte/MP3Effekt.java b/src/com/company/audioEffekte/MP3Effekt.java new file mode 100644 index 0000000..90ff5be --- /dev/null +++ b/src/com/company/audioEffekte/MP3Effekt.java @@ -0,0 +1,9 @@ +package com.company.audioEffekte; + +public class MP3Effekt extends Audioeffekt { + + public MP3Effekt(String dateiname){ + this.dateiname = "MP3Effekt"; + + } +} diff --git a/src/com/company/audioEffekte/OGGEffekt.java b/src/com/company/audioEffekte/OGGEffekt.java new file mode 100644 index 0000000..b4f97cf --- /dev/null +++ b/src/com/company/audioEffekte/OGGEffekt.java @@ -0,0 +1,9 @@ +package com.company.audioEffekte; + +public class OGGEffekt extends Audioeffekt{ + + public OGGEffekt(String dateiname){ + this.dateiname = "OGGEffect"; + + } +} diff --git a/src/com/company/audioEffekte/WAVEffect.java b/src/com/company/audioEffekte/WAVEffect.java new file mode 100644 index 0000000..d6c4ed6 --- /dev/null +++ b/src/com/company/audioEffekte/WAVEffect.java @@ -0,0 +1,9 @@ +package com.company.audioEffekte; + +public class WAVEffect extends Audioeffekt{ + + public WAVEffect(String dateiname){ + this.dateiname = "WAVEffect"; + + } +} \ No newline at end of file diff --git a/src/com/company/audioEffekte/main.java b/src/com/company/audioEffekte/main.java new file mode 100644 index 0000000..f0323b7 --- /dev/null +++ b/src/com/company/audioEffekte/main.java @@ -0,0 +1,5 @@ +package com.company.audioEffekte; + +public class main { + +} diff --git a/src/com/company/lampe/Bulb.java b/src/com/company/lampe/Bulb.java new file mode 100644 index 0000000..f51816b --- /dev/null +++ b/src/com/company/lampe/Bulb.java @@ -0,0 +1,12 @@ +package com.company.lampe; + +import java.security.PublicKey; + +public class Bulb extends Lamp{ + public Bulb(){ + this.Watt = 60; + } + public int power(int hourPerDay){ + return PowerConsuption(this.Watt); + } +} diff --git a/src/com/company/lampe/LEDBulb.java b/src/com/company/lampe/LEDBulb.java new file mode 100644 index 0000000..10b4d5f --- /dev/null +++ b/src/com/company/lampe/LEDBulb.java @@ -0,0 +1,10 @@ +package com.company.lampe; + +public class LEDBulb extends Lamp{ + public LEDBulb(){ + this.Watt = 9; + } + public int power(int hourPerDay){ + return PowerConsuption(this.Watt); + } +} diff --git a/src/com/company/lampe/Lamp.java b/src/com/company/lampe/Lamp.java new file mode 100644 index 0000000..563e495 --- /dev/null +++ b/src/com/company/lampe/Lamp.java @@ -0,0 +1,14 @@ +package com.company.lampe; + +public class Lamp { + + protected int Watt; + public int PowerConsuption(int hoursPerDay){ + + return (this.Watt*hoursPerDay*365)/1000; + } + public int getWatt(){ + + return this.Watt; + } +} diff --git a/src/com/company/lampe/main.java b/src/com/company/lampe/main.java new file mode 100644 index 0000000..72eaa7d --- /dev/null +++ b/src/com/company/lampe/main.java @@ -0,0 +1,11 @@ +package com.company.lampe; + +public class main { + public static void main(String[] args){ + LEDBulb led = new LEDBulb(); + Bulb bulb = new Bulb(); + + System.out.println("The LED lamp consumes "+led.power(5)+" kWh per hour"); + System.out.println("The lamp consumes "+bulb.power(5)+" kWh per hour"); + } +} diff --git a/src/com/company/passwort/Password.java b/src/com/company/passwort/Password.java index d55b167..9abef79 100644 --- a/src/com/company/passwort/Password.java +++ b/src/com/company/passwort/Password.java @@ -5,7 +5,8 @@ public class Password { private char[] passwordaktuell; public Password(char[] passwordAktuell) { - this.passwordaktuell = passwordAktuell; + + this.passwordaktuell = java.util.Arrays.copyOf(passwordAktuell, passwordAktuell.length); } boolean isStrong(String password) { @@ -51,7 +52,7 @@ public class Password { } public boolean isCorrect(char[] passwordEingabe){ - if(passwordEingabe.equals(passwordaktuell)){ + if(passwordEingabe.equals(this.passwordaktuell)){ return true; } else{ return false; diff --git a/src/com/company/voegel/Ente.java b/src/com/company/voegel/Ente.java new file mode 100644 index 0000000..959b396 --- /dev/null +++ b/src/com/company/voegel/Ente.java @@ -0,0 +1,10 @@ +package com.company.voegel; + +public class Ente extends Vogel{ + + boolean kannSchwimmen = true; + void sagHallo(){ + System.out.println("Quak"); + } + +} diff --git a/src/com/company/voegel/Papageil.java b/src/com/company/voegel/Papageil.java new file mode 100644 index 0000000..716e19b --- /dev/null +++ b/src/com/company/voegel/Papageil.java @@ -0,0 +1,7 @@ +package com.company.voegel; + +public class Papageil extends Vogel{ + void sagHallo(){ + System.out.println("Hallo"); + } +} diff --git a/src/com/company/voegel/RentnerPapageil.java b/src/com/company/voegel/RentnerPapageil.java new file mode 100644 index 0000000..c9d0bef --- /dev/null +++ b/src/com/company/voegel/RentnerPapageil.java @@ -0,0 +1,14 @@ +package com.company.voegel; + +public class RentnerPapageil extends Papageil{ + void sagHallo(){ + for (int i = 0; i < 3; i++){ + System.out.println("Hallo "); + } + } + + String getName(){ + System.out.println(name); + return name; + } +} diff --git a/src/com/company/voegel/Vogel.java b/src/com/company/voegel/Vogel.java new file mode 100644 index 0000000..9a8d547 --- /dev/null +++ b/src/com/company/voegel/Vogel.java @@ -0,0 +1,14 @@ +package com.company.voegel; + +public class Vogel { + + String name; + protected boolean kannFliegen = true; + + void sagHallo(){ + } + + String getName(){ + return name; + } +} diff --git a/src/com/company/voegel/voegelMain.java b/src/com/company/voegel/voegelMain.java new file mode 100644 index 0000000..0829d61 --- /dev/null +++ b/src/com/company/voegel/voegelMain.java @@ -0,0 +1,21 @@ +package com.company.voegel; + +public class voegelMain { + + public static void main(String[] args){ + + Ente e = new Ente(); + RentnerPapageil RP = new RentnerPapageil(); + + System.out.println(e.kannFliegen); + RP.sagHallo(); + + Vogel vogel1, vogel2, vogel3; + vogel1 = new Ente(); + vogel1.sagHallo(); + vogel2 = new Papageil(); + vogel2.sagHallo(); + vogel3 = new RentnerPapageil(); + vogel3.sagHallo(); + } +}