This commit is contained in:
raabfe75717 2019-10-24 15:12:20 +02:00
commit 7d4353a57f
3 changed files with 58 additions and 0 deletions

11
First IntelliJ.iml Normal file
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
src/Visitenkarte.java Normal file
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
src/helloWorld.java Normal file
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);
}
}