commit 2e812989e2cc0c86445254816a0b28c442607902 Author: dianagazenbiller Date: Thu Oct 26 16:32:17 2023 +0200 1.save diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f68d109 --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +### IntelliJ IDEA ### +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/Prog3A.iml b/Prog3A.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Prog3A.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/Main.java b/src/Main.java new file mode 100644 index 0000000..8265e58 --- /dev/null +++ b/src/Main.java @@ -0,0 +1,17 @@ +// Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`, +// then press Enter. You can now see whitespace characters in your code. +public class Main { + public static void main(String[] args) { + // Press Opt+Enter with your caret at the highlighted text to see how + // IntelliJ IDEA suggests fixing it. + System.out.printf("Hello and welcome!"); + + // Press Ctrl+R or click the green arrow button in the gutter to run the code. + for (int i = 1; i <= 5; i++) { + + // Press Ctrl+D to start debugging your code. We have set one breakpoint + // for you, but you can always add more by pressing Cmd+F8. + System.out.println("i = " + i); + } + } +} \ No newline at end of file diff --git a/src/Praktikum01/HelloWorld.java b/src/Praktikum01/HelloWorld.java new file mode 100644 index 0000000..322a597 --- /dev/null +++ b/src/Praktikum01/HelloWorld.java @@ -0,0 +1,8 @@ +package Praktikum01; + +public class HelloWorld { + + public static void main(String[] args) { + System.out.println("Hello World!"); + } +} diff --git a/src/Praktikum01/Zahlenfilter.java b/src/Praktikum01/Zahlenfilter.java new file mode 100644 index 0000000..7816172 --- /dev/null +++ b/src/Praktikum01/Zahlenfilter.java @@ -0,0 +1,44 @@ +package Praktikum01; + +public class Zahlenfilter { + + public static void main(String[] args) { + Zahlenfilter(); + } + + public static void istTeilbar5() { + for (int i = 1; i < 201; i++) { + if(i%5==0){ + System.out.println(i+" ist durch 5 teilbar!"); + } + } + } + + public static void endetAuf9() { + for (int i = 1; i < 201; i++) { + if (i % 10 == 9) { + System.out.println(i + " endet auf 9!"); + } + } + } + + public static void sumPrev3() { + for (int i = 1; i < 201; i++) { + if ((i + (i - 1)) % 3 == 0) { + System.out.println(i + " und " + (i - 1) + " addiert ergeben " + (i + (i - 1)) + " und " + (i + (i - 1)) + " ist durch 3 teilbar"); + } + } + } + + public static void Zahlenfilter() { + for (int i = 1; i < 201; i++) { + System.out.println(i); + } + + } + } + } + } +} + +