From 7d4353a57f6eee8e0561ee6c50a68a5c33663605 Mon Sep 17 00:00:00 2001 From: raabfe75717 Date: Thu, 24 Oct 2019 15:12:20 +0200 Subject: [PATCH] init --- First IntelliJ.iml | 11 +++++++++++ src/Visitenkarte.java | 17 +++++++++++++++++ src/helloWorld.java | 30 ++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 First IntelliJ.iml create mode 100644 src/Visitenkarte.java create mode 100644 src/helloWorld.java diff --git a/First IntelliJ.iml b/First IntelliJ.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/First IntelliJ.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/Visitenkarte.java b/src/Visitenkarte.java new file mode 100644 index 0000000..7fb41af --- /dev/null +++ b/src/Visitenkarte.java @@ -0,0 +1,17 @@ +public class Visitenkarte { + + String s; + + String name = "Felix"; + String vorname = "Raab"; + String adresse = "Sigmund-Graff-Str.2"; + int telefonnummer = 8908265; + int alter = 22; + String beruf = "Student"; + + public String toString(){ + System.out.println("-----"); + String s = (name + "," + vorname + "\n" + beruf + "," + alter + "\n" + adresse + "\n" + telefonnummer + "\n") ; + return s; + } +} diff --git a/src/helloWorld.java b/src/helloWorld.java new file mode 100644 index 0000000..4065278 --- /dev/null +++ b/src/helloWorld.java @@ -0,0 +1,30 @@ +public class helloWorld { + + public static void main(String[] args) { + + int zahl = 0; + for (int i = 0; i < 200; i++) { + zahl++; + System.out.println(zahl); + if (zahl % 5 == 0) { + System.out.println(zahl + " ist durch 5 teilbar"); + } + //endung auf 9 + String str = Integer.toString(zahl); + char last = str.charAt(str.length() - 1); + if (last == '9') { + System.out.println(zahl + " endet auf 9"); + } + //teilbar durch 3 + int vorgaenger = zahl - 1; + if ((zahl + vorgaenger) % 3 == 0) { + int ergebnis = (zahl + vorgaenger); + System.out.println(zahl + " und " + vorgaenger + " addiert ergeben " + ergebnis + " und " + ergebnis + " ist durch 3 teilbar"); + } + } + System.out.println(" "); + + Visitenkarte karte = new Visitenkarte(); + System.out.println(karte); + } +}