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
3/.gitingore Normal file
View File

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

BIN
3/3 - Verknüpfung.lnk Normal file

Binary file not shown.

BIN
3/A1.class Normal file

Binary file not shown.

18
3/A1.java Normal file
View File

@@ -0,0 +1,18 @@
public class A1{
public static void main(String args[]) {
char firstChar = 'n';
switch (firstChar) {
case 'j':
System.out.println("ja"); // kein Break
case 'J':
System.out.println("Ja");
break;
case 'n':
System.out.println("nein"); // kein Break
case 'N':
System.out.println("Nein");
break;
} // es gibt kein default
}
}

18
3/A1.~ava Normal file
View File

@@ -0,0 +1,18 @@
public class A1{
public static void main(String args[]) {
char firstChar = 'n';
switch (firstChar) {
case 'j':
System.out.println("ja"); // kein Break
case 'J':
System.out.println("Ja");
break;
case 'n':
System.out.println("nein");
case 'N':
System.out.println("Nein");
break;
} // es gibt kein default
}
}

BIN
3/Alter.class Normal file

Binary file not shown.

12
3/Alter.java Normal file
View File

@@ -0,0 +1,12 @@
public class Alter{
public static void main(String args[]) {
int alter = 40;
if(alter < 50){
System.out.println("Die Rente ist in Sicht");
} else if (alter < 40){
System.out.println("Genau richtig :-)");
} else if (alter < 30){
System.out.println("Du bist aber noch jung!"); // falsche Reihenfolge
}
}
}

12
3/Alter.~ava Normal file
View File

@@ -0,0 +1,12 @@
public class Alter{
public static void main(String args[]) {
int alter = 40;
if(alter < 50){
System.out.println("Die Rente ist in Sicht");
} else if (alter < 40){
System.out.println("Genau richtig :-)");
} else if (alter < 30){
System.out.println("Du bist aber noch jung!");
}
}
}

BIN
3/BMI.class Normal file

Binary file not shown.

48
3/BMI.java Normal file
View File

@@ -0,0 +1,48 @@
import java.util.Scanner;
public class BMI{
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
System.out.print("Gewicht: ");
double gewicht = input.nextDouble();
System.out.print("Große: ");
double grosse = input.nextDouble();
double bmi = (gewicht/ (grosse*grosse));
System.out.println("BMI = " + bmi);
if(bmi < 16) {
System.out.println("Starkes untergewicht");
} else if (bmi <= 17) {
System.out.println("Mäßiges untergewicht");
}
else if (bmi <= 18.5) {
System.out.println("Leichtes untergewicht");
}
else if (bmi <= 25) {
System.out.println("Normalgewicht");
}
else if (bmi <= 30) {
System.out.println("Präadipositas");
}
else if (bmi <= 35) {
System.out.println("Adipositas Grad 1");
}
else if (bmi <= 40) {
System.out.println("Adipositas Grad 2");
}
else {
System.out.println("Adipositas Grad 3");
}
}
}

30
3/BMI.txt Normal file
View File

@@ -0,0 +1,30 @@
String bmi = "Normalgewicht";
switch (bmi) {
case "Starkes untergewicht":
System.out.println("BMI < 16");
break;
case "Mäßiges untergewicht":
System.out.println("16 < BMI < 17");
break;
case "Leichtes untergewicht":
System.out.println("17 < BMI < 18.5");
break;
case "Normalgewicht":
System.out.println("18.5 < BMI < 25");
break;
case "Präadipositas":
System.out.println("25 < BMI < 30");
break;
case "Adipositas Grad 1":
System.out.println("30 < BMI < 35");
break;
case "Adipositas Grad 2":
System.out.println("35 < BMI < 40");
break;
case "Adipositas Grad 3":
System.out.println("BMI > 40");
break;
default:
System.out.println("dd");
} // end of switch mit Switch könnte man

48
3/BMI.~ava Normal file
View File

@@ -0,0 +1,48 @@
import java.util.Scanner;
public class BMI{
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
System.out.print("Gewicht: ");
double gewicht = input.nextDouble();
System.out.print("Große: ");
double grosse = input.nextDouble();
double bmi = (gewicht/ (grosse*grosse));
System.out.println("BMI = " + bmi);
if(bmi <= 16) {
System.out.println("Starkes untergewicht");
} else if (bmi <= 17) {
System.out.println("Mäßiges untergewicht");
}
else if (bmi <= 18.5) {
System.out.println("Leichtes untergewicht");
}
else if (bmi <= 25) {
System.out.println("Normalgewicht");
}
else if (bmi <= 30) {
System.out.println("Präadipositas");
}
else if (bmi <= 35) {
System.out.println("Adipositas Grad 1");
}
else if (bmi <= 40) {
System.out.println("Adipositas Grad 2");
}
else {
System.out.println("Adipositas Grad 3");
}
}
}

1
3/BMI.~xt Normal file
View File

@@ -0,0 +1 @@
mit Switch könnte man

BIN
3/Monat.class Normal file

Binary file not shown.

50
3/Monat.java Normal file
View File

@@ -0,0 +1,50 @@
import java.util.Scanner;
public class Monat {
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
System.out.print("Zahl: ");
int monat = input.nextInt();
switch (monat) {
case 1:
System.out.println("Januar");
break;
case 2:
System.out.println("Februar");
break;
case 3:
System.out.println("März");
break;
case 4:
System.out.println("April");
break;
case 5:
System.out.println("Mai");
break;
case 6:
System.out.println("June");
break;
case 7:
System.out.println("Juli");
break;
case 8:
System.out.println("August");
break;
case 9:
System.out.println("September");
break;
case 10:
System.out.println("Oktober");
break;
case 11:
System.out.println("November");
break;
case 12:
System.out.println("Dezember");
break;
default:
System.out.println("DIe Zahl ist zo groß oder zu niedrig");
} // end of switch
}
}

50
3/Monat.~ava Normal file
View File

@@ -0,0 +1,50 @@
import java.util.Scanner;
public class Monat {
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
System.out.print("Zahl: ");
int monat = input.nextInt();
switch (monat) {
case 1:
System.out.println("Januar");
break;
case 2:
System.out.println("Februar");
break;
case 3:
System.out.println("März");
break;
case 4:
System.out.println("April");
break;
case 5:
System.out.println("Mai");
break;
case 6:
System.out.println("June");
break;
case 7:
System.out.println("Juli");
break;
case 8:
System.out.println("August");
break;
case 9:
System.out.println("September");
break;
case 10:
System.out.println("Oktober");
break;
case 11:
System.out.println("November");
break;
case 12:
System.out.println("Dezember");
break;
default:
System.out.println("DIe Zahl ist zo groß oder zu niedrig");
} // end of switch
}
}

BIN
3/SwitchT.class Normal file

Binary file not shown.

28
3/SwitchT.java Normal file
View File

@@ -0,0 +1,28 @@
public class SwitchT {
public static void main(String args[]) {
int zahl = 1;
switch (zahl) {
case 1:
System.out.println("Sehr gut");
break;
case 2:
System.out.println("Gut");
break;
case 3:
System.out.println("Befreidigend");
break;
case 4:
System.out.println("Ausreichend");
break;
case 5:
System.out.println("Mangelhaft");
break;
case 6:
System.out.println("Ungenügend");
break;
default:
System.out.println("Keine Note");
} // end of switch
}
}

28
3/SwitchT.~ava Normal file
View File

@@ -0,0 +1,28 @@
public class SwitchT {
public static void main(String args[]) {
int zahl = 1;
switch (zahl) {
case 1:
System.out.println("Sehr gut");
break;
case 2:
System.out.println("Gut");
break;
case 3:
System.out.println("Befreidigend");
break;
case 4:
System.out.println("Ausreichend");
break;
case 5:
System.out.println("Mangelhaft");
break;
case 6:
System.out.println("Ungenügend");
break;
default:
System.out.println("Keine Note");
} // end of switch
}
}

6
3/Verweigung.java Normal file
View File

@@ -0,0 +1,6 @@
public class Verzweigung {
public static void main(String args[]) {
int alter = 38
}
}

BIN
3/Verzweigung.class Normal file

Binary file not shown.

25
3/Verzweigung.java Normal file
View File

@@ -0,0 +1,25 @@
public class Verzweigung {
public static void main(String args[]) {
int alter = 30;
if(alter <= 20) {
System.out.println("Du bist noch jung");
}
else if (alter < 30) {
System.out.println("ISt noch ok!");
}
else if (alter < 40) {
System.out.println("Grenzwertig :-P");
}
else if (alter < 50) {
System.out.println("Die Rente ist in sicht");
}
else if (alter < 60) {
System.out.println("Bist du baer alt");
}
else {
System.out.println("Na, ganz frish");
} // end of if-else
}
}

25
3/Verzweigung.~ava Normal file
View File

@@ -0,0 +1,25 @@
public class Verzweigung {
public static void main(String args[]) {
int alter = 30;
if(alter <= 20) {
System.out.println("Du bist noch jung");
}
else if (alter < 30) {
System.out.println("ISt noch ok!");
}
else if (alter < 40) {
System.out.println("Grenzwertig :-P");
}
else if (alter < 50) {
System.out.println("Die Rente ist in sicht");
}
else if (alter < 60) {
System.out.println("Bist du baer alt");
}
else {
System.out.println("Na, ganz frish");
} // end of if-else
}
}

0
3/error.txt Normal file
View File