Browse Source

init

master
raabfe75717 4 years ago
commit
7d4353a57f
3 changed files with 58 additions and 0 deletions
  1. 11
    0
      First IntelliJ.iml
  2. 17
    0
      src/Visitenkarte.java
  3. 30
    0
      src/helloWorld.java

+ 11
- 0
First IntelliJ.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>

+ 17
- 0
src/Visitenkarte.java View File

@@ -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;
}
}

+ 30
- 0
src/helloWorld.java View File

@@ -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);
}
}

Loading…
Cancel
Save