Add Task 6 sorter, fix method signatures, generate solution PDF

This commit is contained in:
2026-04-08 20:27:43 +02:00
parent cd51025dc4
commit a958ba600f
7 changed files with 185 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ public class PrimeNumberGenerator {
}
return true;
}
private int countPrimes() {
public int countPrimeNumbers() {
int count = 0;
for (int i = 2; i <= maximum; i++) {
if (isPrime(i)) {
@@ -37,7 +37,7 @@ public class PrimeNumberGenerator {
System.out.println("maximum,Anzahl Primzahlen (Algorithmus),maximum/ln(maximum) (Schätzung)");
for (int max : testValues) {
PrimeNumberGenerator generator = new PrimeNumberGenerator(max);
int counted = generator.countPrimes();
int counted = generator.countPrimeNumbers();
double estimated = max / Math.log(max);
System.out.printf("%d,%d,%.1f%n", max, counted, estimated);
}