finish VL 7

This commit is contained in:
Matti 2024-04-15 14:47:58 +02:00
parent d38b5c24ef
commit 7094a5fb2c
5 changed files with 17 additions and 6 deletions

View File

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -10,7 +10,7 @@ Dateien wie Bilder die zur Lösung einer Aufgabe gehören sind in <br><ins>Medie
- Vorlesung 4 komplett - Vorlesung 4 komplett
- Vorlesung 5 Aufgabe 1 & 3 von 3 - Vorlesung 5 Aufgabe 1 & 3 von 3
- Vorlesung 6 Aufgabe komplett - Vorlesung 6 Aufgabe komplett
- Vorlesung 7 Aufgabe 1 - Vorlesung 7 Aufgabe komplett
## Angefangene unfertige Lösungen: ## Angefangene unfertige Lösungen:
- Damenproblem: VL 5 Aufgabe 2 - Damenproblem: VL 5 Aufgabe 2

View File

@ -9,15 +9,22 @@ public class Anwendung {
round_robert.setRadius(4); round_robert.setRadius(4);
System.out.println(round_robert.getArea()); System.out.println(round_robert.getArea());
System.out.println(round_robert.getCircumference()); System.out.println(round_robert.getCircumference());
System.out.println("=========");
round_robert.setRadius(5); round_robert.setRadius(5);
System.out.println(round_robert.getArea()) System.out.println(round_robert.getArea());
;System.out.println(round_robert.getCircumference()); System.out.println(round_robert.getCircumference());
System.out.println("=========");
round_robert.setRadius(1); round_robert.setRadius(1);
System.out.println(round_robert.getArea()); System.out.println(round_robert.getArea());
System.out.println(round_robert.getCircumference()); System.out.println(round_robert.getCircumference());
System.out.println("=================");
Regular_n_gon robin_regular = new Regular_n_gon();
robin_regular.setSideLength(5);
robin_regular.setEdges(4);
System.out.println(robin_regular.getArea());
System.out.println(robin_regular.getCircumference());
} }
} }

View File

@ -8,6 +8,10 @@ public class Regular_n_gon extends Form{
this.edges = edges; this.edges = edges;
} }
public void setSideLength(float sideLength) {
this.sideLength = sideLength;
}
public int getEdges() { public int getEdges() {
return edges; return edges;
} }
@ -21,6 +25,6 @@ public class Regular_n_gon extends Form{
} }
public double getArea() { public double getArea() {
return 0; return (0.25 * getEdges() * Math.pow(getSideLength(),2) * (1/Math.tan(Math.PI / getEdges())));
} }
} }