This commit is contained in:
Mykola Fesenko
2025-07-29 08:08:23 +02:00
commit 899a05907b
355 changed files with 11002 additions and 0 deletions

2
9/.gitingore Normal file
View File

@@ -0,0 +1,2 @@
*.class
*.~ava

BIN
9/Artikel.class Normal file

Binary file not shown.

64
9/Artikel.java Normal file
View File

@@ -0,0 +1,64 @@
/**
*
* Beschreibung
*
* @version 1.0 vom 11.03.2025
* @author
*/
public class Artikel {
// Anfang Attribute
private int artikelNr;
private String artikelBez;
private double ekPreis;
private int bestand;
// Ende Attribute
public Artikel(int artikelNr, String artikelBez, double ekPreis, int bestand) {
this.artikelNr = artikelNr;
this.artikelBez = artikelBez;
this.ekPreis = ekPreis;
this.bestand = bestand;
}
// Anfang Methoden
public int getArtikelNr() {
return artikelNr;
}
public void setArtikelNr(int artikelNrNeu) {
artikelNr = artikelNrNeu;
}
public String getArtikelBez() {
return artikelBez;
}
public void setArtikelBez(String artikelBezNeu) {
artikelBez = artikelBezNeu;
}
public double getEkPreis() {
return ekPreis;
}
public void setEkPreis(double ekPreisNeu) {
ekPreis = ekPreisNeu;
}
public int getBestand() {
return bestand;
}
public void setBestand(int bestandNeu) {
bestand = bestandNeu;
}
public double artikelWert() {
return bestand*ekPreis;
}
// Ende Methoden
} // end of Artikel

27
9/Artikel.uml Normal file
View File

@@ -0,0 +1,27 @@
[Files]
File0=Artikel.java
[Box: - Artikel]
X=20
Y=40
MinVis=0
ShowParameter=4
SortOrder=0
ShowIcons=1
[Diagram]
comments=0
OffsetX=0
OffsetY=0
Visibility=0
ShowParameter=4
SortOrder=0
ShowIcons=1
ShowConnections=0
Fontname=Segoe UI
Fontsize=12
ShowObjectDiagram=0
[Interactive]
I0=

64
9/Artikel.~ava Normal file
View File

@@ -0,0 +1,64 @@
/**
*
* Beschreibung
*
* @version 1.0 vom 11.03.2025
* @author
*/
public class Artikel {
// Anfang Attribute
public int artikelNr;
private String artikelBez;
private double ekPreis;
private int bestand;
// Ende Attribute
public Artikel(int artikelNr, String artikelBez, double ekPreis, int bestand) {
this.artikelNr = artikelNr;
this.artikelBez = artikelBez;
this.ekPreis = ekPreis;
this.bestand = bestand;
}
// Anfang Methoden
public int getArtikelNr() {
return artikelNr;
}
public void setArtikelNr(int artikelNrNeu) {
artikelNr = artikelNrNeu;
}
public String getArtikelBez() {
return artikelBez;
}
public void setArtikelBez(String artikelBezNeu) {
artikelBez = artikelBezNeu;
}
public double getEkPreis() {
return ekPreis;
}
public void setEkPreis(double ekPreisNeu) {
ekPreis = ekPreisNeu;
}
public int getBestand() {
return bestand;
}
public void setBestand(int bestandNeu) {
bestand = bestandNeu;
}
public double artikelWert() {
// TODO hier Quelltext einfügen
return 0;
}
// Ende Methoden
} // end of Artikel

BIN
9/Aufgabe1A.class Normal file

Binary file not shown.

33
9/Aufgabe1A.java Normal file
View File

@@ -0,0 +1,33 @@
/**
*
* Beschreibung
*
* @version 1.0 vom 11.03.2025
* @author
*/
public class Aufgabe1A {
// Anfang Attribute
// Ende Attribute
// Anfang Methoden
public static void main(String args[]) {
Rechteck sq = new Rechteck();
sq.seiteA = 5;
sq.seiteB = 8;
System.out.println("SeiteA: " + sq.seiteA + " cm");
System.out.println("SeiteB: " + sq.seiteB+ " cm");
sq.berechneFlaeche();
Kreis kr = new Kreis();
kr.radius = 5.0;
System.out.println("Radius: " + kr.radius);
kr.berechneU();
kr.berechneF();
}
// Ende Methoden
} // end of Aufgabe1A

27
9/Aufgabe1A.uml Normal file
View File

@@ -0,0 +1,27 @@
[Files]
File0=Aufgabe1A.java
[Box: - Aufgabe1A]
X=20
Y=40
MinVis=0
ShowParameter=4
SortOrder=0
ShowIcons=1
[Diagram]
comments=0
OffsetX=0
OffsetY=0
Visibility=0
ShowParameter=4
SortOrder=0
ShowIcons=1
ShowConnections=0
Fontname=Segoe UI
Fontsize=12
ShowObjectDiagram=0
[Interactive]
I0=

33
9/Aufgabe1A.~ava Normal file
View File

@@ -0,0 +1,33 @@
/**
*
* Beschreibung
*
* @version 1.0 vom 11.03.2025
* @author
*/
public class Aufgabe1A {
// Anfang Attribute
// Ende Attribute
// Anfang Methoden
public static void main(String args[]) {
Rechteck sq = new Rechteck();
sq.seiteA = 5;
sq.seiteB = 8;
System.out.println("SeiteA: " + sq.seiteA + " cm");
System.out.println("SeiteB: " + sq.seiteB+ " cm");
sq.berechneFlaeche();
Kreis kr = new Kreis();
kr.radius = 4.0;
System.out.println("Radius: " + kr.radius);
kr.berechneU();
kr.berechneF();
}
// Ende Methoden
} // end of Aufgabe1A

BIN
9/Aufgabe2A.class Normal file

Binary file not shown.

31
9/Aufgabe2A.java Normal file
View File

@@ -0,0 +1,31 @@
/**
*
* Beschreibung
*
* @version 1.0 vom 11.03.2025
* @author
*/
public class Aufgabe2A {
public static void main(String args[]) {
Artikel[] lage = new Artikel[5];
double gesamtLageWert = 0;
lage[0] = new Artikel(815,"Reifen",4.35,8);
lage[1] = new Artikel(1435,"Klingel",6.94,12);
lage[2] = new Artikel(37,"Rücklicht",12.52,24);
lage[3] = new Artikel(294,"Vorderlicht",17.28,18);
lage[4] = new Artikel(536,"Sattel",29.94,15);
for (int i = 0; i < lage.length; i++) {
double artikelWert = lage[i].artikelWert();
gesamtLageWert+= artikelWert;
System.out.println("ArtikelName: " + lage[i].getArtikelBez() + " , ArtikelWert: "+artikelWert);
}
System.out.println("GesamteWert: " + gesamtLageWert);
}
// Ende Methoden
} // end of Aufgabe2A

27
9/Aufgabe2A.uml Normal file
View File

@@ -0,0 +1,27 @@
[Files]
File0=Aufgabe2A.java
[Box: - Aufgabe2A]
X=20
Y=40
MinVis=0
ShowParameter=4
SortOrder=0
ShowIcons=1
[Diagram]
comments=0
OffsetX=0
OffsetY=0
Visibility=0
ShowParameter=4
SortOrder=0
ShowIcons=1
ShowConnections=0
Fontname=Segoe UI
Fontsize=12
ShowObjectDiagram=0
[Interactive]
I0=

31
9/Aufgabe2A.~ava Normal file
View File

@@ -0,0 +1,31 @@
/**
*
* Beschreibung
*
* @version 1.0 vom 11.03.2025
* @author
*/
public class Aufgabe2A {
public static void main() {
Artikel[] lage = new Artikel[5];
double gesamtLageWert = 0;
lage[0] = new Artikel(815,"Reifen",4.35,8);
lage[1] = new Artikel(1435,"Klingel",6.94,12);
lage[2] = new Artikel(37,"Rücklicht",12.52,24);
lage[3] = new Artikel(294,"Vorderlicht",17.28,18);
lage[4] = new Artikel(536,"Sattel",29.94,15);
for (int i = 0; i < lage.length; i++) {
double artikelWert = lage[i].artikelWert();
gesamtLageWert+= artikelWert;
System.out.println("ArtikelName: " + lage[i].getArtikelBez() + " , ArtikelWert: "+artikelWert);
}
System.out.println("GesamteWert: " + gesamtLageWert);
}
// Ende Methoden
} // end of Aufgabe2A

BIN
9/Auto.class Normal file

Binary file not shown.

85
9/Auto.java Normal file
View File

@@ -0,0 +1,85 @@
/**
*
* Beschreibung
*
* @version 1.0 vom 11.03.2025
* @author Fesenko
*/
public class Auto {
// Anfang Attribute
private int anzahlTueren;
public String hersteller;
private String typ;
private int kilometerStand;
private double tankinhalt;
private double tankvebrauch;
public double maxTankinhalt;
// Ende Attribute
// Anfang Methoden
public int getAnzahlTueren() {
return anzahlTueren;
}
public void setAnzahlTueren(int anzahlTuerenNeu) {
if(anzahlTuerenNeu < 2 || anzahlTuerenNeu < 7) {
anzahlTueren = anzahlTuerenNeu;
}
else {
System.out.println("Zu viel Türen");
} // end of if-else
}
public int getKilometerStand() {
return kilometerStand;
}
public void setKilometerStand(int kilometerStandNeu) {
kilometerStand = kilometerStandNeu;
}
public void fahren(int km) {
if(km <= ((100)/tankvebrauch)*tankinhalt) {
System.out.println("Gefahren: " + km + " km!");
kilometerStand += km;
tankinhalt -= (km*(tankvebrauch/100));
}
else {
System.out.println("man könnte nur: " + ((100)/tankvebrauch)*tankinhalt + " km maximal fahren!");
}
}
public double getTankinhalt() {
return tankinhalt;
}
public void setTankinhalt(double tankinhaltNeu) {
tankinhalt = tankinhaltNeu;
}
public double getTankvebrauch() {
return tankvebrauch;
}
public void setTankvebrauch(double tankvebrauchNeu) {
tankvebrauch = tankvebrauchNeu;
}
public void tanken(double anzahl) {
if(anzahl+tankinhalt > maxTankinhalt) {
System.out.println("Es ist zu viel");
}
else {
tankinhalt += anzahl;
} // end of if-else
}
// Ende Methoden
} // end of Auto

27
9/Auto.uml Normal file
View File

@@ -0,0 +1,27 @@
[Files]
File0=Auto.java
[Box: - Auto]
X=20
Y=40
MinVis=0
ShowParameter=4
SortOrder=0
ShowIcons=1
[Diagram]
comments=0
OffsetX=0
OffsetY=0
Visibility=0
ShowParameter=4
SortOrder=0
ShowIcons=1
ShowConnections=0
Fontname=Segoe UI
Fontsize=12
ShowObjectDiagram=0
[Interactive]
I0=

79
9/Auto.~ava Normal file
View File

@@ -0,0 +1,79 @@
/**
*
* Beschreibung
*
* @version 1.0 vom 11.03.2025
* @author Fesenko
*/
public class Auto {
// Anfang Attribute
private int anzahlTueren;
public String hersteller;
private String typ;
private int kilometerStand;
private double tankinhalt;
private double tankvebrauch;
public double maxTankinhalt;
// Ende Attribute
// Anfang Methoden
public int getAnzahlTueren() {
return anzahlTueren;
}
public void setAnzahlTueren(int anzahlTuerenNeu) {
if(anzahlTuerenNeu < 2 || anzahlTuerenNeu < 7) {
anzahlTueren = anzahlTuerenNeu;
}
else {
System.out.println("Zu viel Türen");
} // end of if-else
}
public int getKilometerStand() {
return kilometerStand;
}
public void setKilometerStand(int kilometerStandNeu) {
kilometerStand = kilometerStandNeu;
}
public void fahren(int km) {
System.out.println("Gefahren: " + km + " km!");
kilometerStand += km;
tankinhalt -= (km*(tankvebrauch/100));
System.out.println("man könnte noch: " + ((100)/tankvebrauch)*tankinhalt + " km fahren!");
}
public double getTankinhalt() {
return tankinhalt;
}
public void setTankinhalt(double tankinhaltNeu) {
tankinhalt = tankinhaltNeu;
}
public double getTankvebrauch() {
return tankvebrauch;
}
public void setTankvebrauch(double tankvebrauchNeu) {
tankvebrauch = tankvebrauchNeu;
}
public void tanken(double anzahl) {
if(anzahl+tankinhalt > maxTankinhalt) {
System.out.println("Es ist zu viel");
}
else {
tankinhalt += anzahl;
} // end of if-else
}
// Ende Methoden
} // end of Auto

BIN
9/AutoAufruf.class Normal file

Binary file not shown.

32
9/AutoAufruf.java Normal file
View File

@@ -0,0 +1,32 @@
public class AutoAufruf {
public static void main(String args[]) {
Auto car = new Auto();
car.setAnzahlTueren(5);
car.hersteller = "VW GOLF";
car.maxTankinhalt = 70.0;
car.setKilometerStand(32768);
car.setTankinhalt(60.0);
car.setTankvebrauch(6.4);
System.out.println("Hersteller: " + car.hersteller);
System.out.println("Türen: " + car.getAnzahlTueren());
System.out.println("KilometerStand: " + car.getKilometerStand());
System.out.println("Tankinhalt: " + car.getTankinhalt());
System.out.println("Tankinvebrauch: " + car.getTankvebrauch());
car.fahren(100);
System.out.println("KilometerStand: " + car.getKilometerStand());
System.out.println("Tankinhalt: " + car.getTankinhalt());
car.fahren(1000);
System.out.println("KilometerStand: " + car.getKilometerStand());
System.out.println("Tankinhalt: " + car.getTankinhalt());
car.tanken(10);
System.out.println("Tankinhalt: " + car.getTankinhalt());
}
}

27
9/AutoAufruf.uml Normal file
View File

@@ -0,0 +1,27 @@
[Files]
File0=AutoAufruf.java
[Box: - AutoAufruf]
X=20
Y=40
MinVis=0
ShowParameter=4
SortOrder=0
ShowIcons=1
[Diagram]
comments=0
OffsetX=0
OffsetY=0
Visibility=0
ShowParameter=4
SortOrder=0
ShowIcons=1
ShowConnections=0
Fontname=Segoe UI
Fontsize=12
ShowObjectDiagram=0
[Interactive]
I0=

28
9/AutoAufruf.~ava Normal file
View File

@@ -0,0 +1,28 @@
public class AutoAufruf {
public static void main(String args[]) {
Auto car = new Auto();
car.setAnzahlTueren(5);
car.hersteller = "VW GOLF";
car.maxTankinhalt = 70.0;
car.setKilometerStand(32768);
car.setTankinhalt(60.0);
car.setTankvebrauch(6.4);
System.out.println("Hersteller: " + car.hersteller);
System.out.println("Türen: " + car.getAnzahlTueren());
System.out.println("KilometerStand: " + car.getKilometerStand());
System.out.println("Tankinhalt: " + car.getTankinhalt());
System.out.println("Tankinvebrauch: " + car.getTankvebrauch());
car.fahren(938);
System.out.println("KilometerStand: " + car.getKilometerStand());
System.out.println("Tankinhalt: " + car.getTankinhalt());
car.tanken(10);
System.out.println("Tankinhalt: " + car.getTankinhalt());
}
}

BIN
9/Kreis.class Normal file

Binary file not shown.

26
9/Kreis.java Normal file
View File

@@ -0,0 +1,26 @@
/**
*
* Beschreibung
*
* @version 1.0 vom 11.03.2025
* @author
*/
public class Kreis {
// Anfang Attribute
public double radius;
// Ende Attribute
// Anfang Methoden
public void berechneU() {
System.out.println("UMfang: " + (2 * radius * Math.PI));
}
public void berechneF() {
System.out.println("Fläche: "+ (Math.PI * Math.pow(radius,2) ));
}
// Ende Methoden
} // end of Kreis

27
9/Kreis.uml Normal file
View File

@@ -0,0 +1,27 @@
[Files]
File0=Kreis.java
[Box: - Kreis]
X=20
Y=40
MinVis=0
ShowParameter=4
SortOrder=0
ShowIcons=1
[Diagram]
comments=0
OffsetX=0
OffsetY=0
Visibility=0
ShowParameter=4
SortOrder=0
ShowIcons=1
ShowConnections=0
Fontname=Segoe UI
Fontsize=12
ShowObjectDiagram=0
[Interactive]
I0=

26
9/Kreis.~ava Normal file
View File

@@ -0,0 +1,26 @@
/**
*
* Beschreibung
*
* @version 1.0 vom 11.03.2025
* @author
*/
public class Kreis {
// Anfang Attribute
public double radius;
// Ende Attribute
// Anfang Methoden
public void berechneU() {
System.out.println("UMfang: " + (2 * radius * Math.PI));
}
public void berechneF() {
System.out.println("Fläche: "+ (Math.PI * Math.pow(radius,2) );
}
// Ende Methoden
} // end of Kreis

BIN
9/Rechteck.class Normal file

Binary file not shown.

24
9/Rechteck.java Normal file
View File

@@ -0,0 +1,24 @@
/**
*
* Beschreibung
*
* @version 1.0 vom 11.03.2025
* @author
*/
public class Rechteck {
// Anfang Attribute
public int seiteA;
public int seiteB;
// Ende Attribute
// Anfang Methoden
public void berechneFlaeche() {
System.out.println("Fläche: " + (seiteA*seiteB) + "cm²");
}
// Ende Methoden
} // end of Rechteck

27
9/Rechteck.uml Normal file
View File

@@ -0,0 +1,27 @@
[Files]
File0=Rechteck.java
[Box: - Rechteck]
X=20
Y=40
MinVis=0
ShowParameter=4
SortOrder=0
ShowIcons=1
[Diagram]
comments=0
OffsetX=0
OffsetY=0
Visibility=0
ShowParameter=4
SortOrder=0
ShowIcons=1
ShowConnections=0
Fontname=Segoe UI
Fontsize=12
ShowObjectDiagram=0
[Interactive]
I0=

24
9/Rechteck.~ava Normal file
View File

@@ -0,0 +1,24 @@
/**
*
* Beschreibung
*
* @version 1.0 vom 11.03.2025
* @author
*/
public class Rechteck {
// Anfang Attribute
public int seiteA;
public int seiteB;
// Ende Attribute
// Anfang Methoden
public void berechneFlaeche() {
System.out.println("Fläche: " + (seiteA*seiteB));
}
// Ende Methoden
} // end of Rechteck