backup
This commit is contained in:
2
5/.gitingore
Normal file
2
5/.gitingore
Normal file
@@ -0,0 +1,2 @@
|
||||
*.class
|
||||
*.~ava
|
||||
BIN
5/Artikel.class
Normal file
BIN
5/Artikel.class
Normal file
Binary file not shown.
64
5/Artikel.java
Normal file
64
5/Artikel.java
Normal 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
|
||||
27
5/Artikel.uml
Normal file
27
5/Artikel.uml
Normal 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=
|
||||
|
||||
BIN
5/Aufgabe3.class
Normal file
BIN
5/Aufgabe3.class
Normal file
Binary file not shown.
16
5/Aufgabe3.java
Normal file
16
5/Aufgabe3.java
Normal file
@@ -0,0 +1,16 @@
|
||||
public class Aufgabe3 {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("3 * 4 = " + mult(3,4));
|
||||
System.out.println("45 * 12 = " + mult(45,12));
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static int mult(int a, int b) {
|
||||
int result=0;
|
||||
for (int i = a; i != 0 ;i-- ) {
|
||||
result+=b;
|
||||
} // end of for
|
||||
return result;
|
||||
}
|
||||
}
|
||||
27
5/Aufgabe3.uml
Normal file
27
5/Aufgabe3.uml
Normal file
@@ -0,0 +1,27 @@
|
||||
[Files]
|
||||
File0=Aufgabe3.java
|
||||
|
||||
[Box: - Aufgabe3]
|
||||
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=
|
||||
|
||||
16
5/Aufgabe3.~ava
Normal file
16
5/Aufgabe3.~ava
Normal file
@@ -0,0 +1,16 @@
|
||||
public class Aufgabe3 {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("3 * 4 = " + mult(3,4));
|
||||
System.out.println("45 * 12 = " + mult(45,12));
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static int mult(int a, int b) {
|
||||
int result=0;
|
||||
for (int i = a; i != 0 ;i-- ) {
|
||||
result+=b;
|
||||
} // end of for
|
||||
return result;
|
||||
}
|
||||
}
|
||||
BIN
5/Aufgabe4.class
Normal file
BIN
5/Aufgabe4.class
Normal file
Binary file not shown.
20
5/Aufgabe4.java
Normal file
20
5/Aufgabe4.java
Normal file
@@ -0,0 +1,20 @@
|
||||
import java.util.Arrays;
|
||||
public class Aufgabe4 {
|
||||
public static void main(String[] args) {
|
||||
int[] array = {12,10,4,45,7};
|
||||
System.out.println(Arrays.toString(array));
|
||||
printArray(sort(array));
|
||||
}
|
||||
|
||||
|
||||
public static int[] sort(int[] arr) {
|
||||
Arrays.sort(arr);
|
||||
return arr;
|
||||
|
||||
}
|
||||
|
||||
public static void printArray(int[] arr) {
|
||||
System.out.println("Array:" + Arrays.toString(arr));
|
||||
|
||||
}
|
||||
}
|
||||
19
5/Aufgabe4.~ava
Normal file
19
5/Aufgabe4.~ava
Normal file
@@ -0,0 +1,19 @@
|
||||
import java.util.Arrays;
|
||||
public class Aufgabe4 {
|
||||
public static void main(String[] args) {
|
||||
int[] array = {12,10,4,45,7};
|
||||
printArray(sort(array));
|
||||
}
|
||||
|
||||
|
||||
public static int[] sort(int[] arr) {
|
||||
Arrays.sort(arr);
|
||||
return arr;
|
||||
|
||||
}
|
||||
|
||||
public static void printArray(int[] arr) {
|
||||
System.out.println("Array:" + Arrays.toString(arr));
|
||||
|
||||
}
|
||||
}
|
||||
BIN
5/Kreisflaeche.class
Normal file
BIN
5/Kreisflaeche.class
Normal file
Binary file not shown.
14
5/Kreisflaeche.java
Normal file
14
5/Kreisflaeche.java
Normal file
@@ -0,0 +1,14 @@
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public class Kreisflaeche {
|
||||
public static DecimalFormat d = new DecimalFormat("0.00");
|
||||
public static void main(String[] args) {
|
||||
kreisflaecheB(2);
|
||||
|
||||
}
|
||||
public static void kreisflaecheB( double r) {
|
||||
System.out.println(d.format((Math.PI * Math.pow(r,2)) ));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
14
5/Kreisflaeche.~ava
Normal file
14
5/Kreisflaeche.~ava
Normal file
@@ -0,0 +1,14 @@
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public class Kreisflaeche {
|
||||
public static DecimalFormat d = new DecimalFormat("0.00");
|
||||
public static void main(String[] args) {
|
||||
kreisflaecheB(2);
|
||||
|
||||
}
|
||||
public static void kreisflaecheB( double r) {
|
||||
System.out.println(d.format(Math.round( (Math.PI * Math.pow(r,2)) )));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
BIN
5/Kreisflaeche2.class
Normal file
BIN
5/Kreisflaeche2.class
Normal file
Binary file not shown.
51
5/Kreisflaeche2.java
Normal file
51
5/Kreisflaeche2.java
Normal file
@@ -0,0 +1,51 @@
|
||||
import java.util.Scanner;
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public class Kreisflaeche2 {
|
||||
public static DecimalFormat antwortFormat = new DecimalFormat("0.00");
|
||||
public static void main(String[] args) {
|
||||
|
||||
Scanner input = new Scanner(System.in);
|
||||
double radius = 0;
|
||||
boolean ende = false;
|
||||
System.out.print("Radius: ");
|
||||
radius = input.nextDouble();
|
||||
System.out.println("Rad = " + radius);
|
||||
|
||||
|
||||
while (!ende) {
|
||||
System.out.println("Was wollen Sie machen?");
|
||||
System.out.println("K, U oder V finden");
|
||||
String wahl = input.next();
|
||||
switch (wahl) {
|
||||
case "K":
|
||||
System.out.println("Kreisfläche: " + antwortFormat.format( kreisflaecheB(radius)));
|
||||
break;
|
||||
case "U":
|
||||
System.out.println("Umfang - " + antwortFormat.format( umfang(radius)));
|
||||
break;
|
||||
case "V":
|
||||
System.out.println("Volumen - " + antwortFormat.format( volumen(radius)));
|
||||
break;
|
||||
default:
|
||||
System.out.println("Falsch");
|
||||
ende = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public static double kreisflaecheB( double r) {
|
||||
return (Math.PI * Math.pow(r,2) );
|
||||
}
|
||||
|
||||
public static double umfang(double r) {
|
||||
return (2 * r * Math.PI);
|
||||
|
||||
}
|
||||
public static double volumen(double r) {
|
||||
return ((4/3) * Math.PI * Math.pow(r,3));
|
||||
|
||||
}
|
||||
}
|
||||
51
5/Kreisflaeche2.~ava
Normal file
51
5/Kreisflaeche2.~ava
Normal file
@@ -0,0 +1,51 @@
|
||||
import java.util.Scanner;
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public class Kreisflaeche2 {
|
||||
public static DecimalFormat antwortFormat = new DecimalFormat("0.00");
|
||||
public static void main(String[] args) {
|
||||
|
||||
Scanner input = new Scanner(System.in);
|
||||
double radius = 0;
|
||||
boolean ende = false;
|
||||
System.out.print("Radius: ");
|
||||
radius = input.nextDouble();
|
||||
System.out.println("Rad = " + radius);
|
||||
|
||||
|
||||
while (!ende) {
|
||||
System.out.println("Was wollen Sie machen?");
|
||||
System.out.println("K, U oder V finden");
|
||||
String wahl = input.next();
|
||||
switch (wahl) {
|
||||
case "K":
|
||||
System.out.println("Kreisfläche: " + antwortFormat.format( kreisflaecheB(radius)));
|
||||
break;
|
||||
case "U":
|
||||
System.out.println("Umfang - " + antwortFormat.format( umfang(radius)));
|
||||
break;
|
||||
case "V":
|
||||
System.out.println("Volumen - " + antwortFormat.format( volumen(radius)));
|
||||
break;
|
||||
default:
|
||||
System.out.println("Falsch");
|
||||
ende = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public static double kreisflaecheB( double r) {
|
||||
return (Math.PI * Math.pow(r,2) );
|
||||
}
|
||||
|
||||
public static double umfang(double r) {
|
||||
return (2 * r * Math.PI);
|
||||
|
||||
}
|
||||
public static double volumen(double r) {
|
||||
return ((4/3) * Math.PI * Math.pow(r,3));
|
||||
|
||||
}
|
||||
}
|
||||
0
5/error.txt
Normal file
0
5/error.txt
Normal file
Reference in New Issue
Block a user