Browse Source

Init

master
kowalikto76735 4 years ago
commit
0719d86fed
3 changed files with 58 additions and 0 deletions
  1. 11
    0
      FirsthelliJ.iml
  2. 29
    0
      src/HelloWorld.java
  3. 18
    0
      src/Visitenkarte.java

+ 11
- 0
FirsthelliJ.iml View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

+ 29
- 0
src/HelloWorld.java View File

@@ -0,0 +1,29 @@
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.");
}
String str = Integer.toString(ZAHL); //int zu String umwandeln
char c = str.charAt(str.length() - 1); //an der stelle 1 überprüfen
if (c == '9') {
System.out.println(ZAHL + " endet auf 9.");
}
int VORG = ZAHL - 1;
if ((ZAHL + VORG) %3 == 0){
int ERG = (ZAHL + VORG);
System.out.println(ZAHL+ " und " + VORG + " addiert ergeben " + ERG+ " und " + ERG + " ist durch 3 teilbar" );


}
}

Visitenkarte vis = new Visitenkarte();
System.out.println(vis);
}
}

+ 18
- 0
src/Visitenkarte.java View File

@@ -0,0 +1,18 @@
public class Visitenkarte {


String name = "Kowalik";
String vorname = "Tomasz";
String beruf = "Student";
String adresse = "Luisenstraße 14, 90762 Fürth";
int alter = 27;
String telefonnummer = "01717075360";


public String toString() {
String s = name + ", " + vorname + "\n" + beruf + "," + alter + "\n" + telefonnummer;
return s;
}
}



Loading…
Cancel
Save