init
This commit is contained in:
commit
7d4353a57f
11
First IntelliJ.iml
Normal file
11
First IntelliJ.iml
Normal 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
17
src/Visitenkarte.java
Normal 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
30
src/helloWorld.java
Normal 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…
x
Reference in New Issue
Block a user