Browse Source

prog3

main
moritz 1 month ago
commit
749579a6f8
7 changed files with 97 additions and 0 deletions
  1. 29
    0
      .gitignore
  2. 8
    0
      .idea/.gitignore
  3. 6
    0
      .idea/misc.xml
  4. 8
    0
      .idea/modules.xml
  5. 15
    0
      src/Main.java
  6. 5
    0
      src/helloWorld.java
  7. 26
    0
      src/praktikum01/Zahlenfelder.java

+ 29
- 0
.gitignore View File

@@ -0,0 +1,29 @@
### IntelliJ IDEA ###
out/
!**/src/main/**/out/
!**/src/test/**/out/

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store

+ 8
- 0
.idea/.gitignore View File

@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

+ 6
- 0
.idea/misc.xml View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="openjdk-23" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

+ 8
- 0
.idea/modules.xml View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/prog3.iml" filepath="$PROJECT_DIR$/prog3.iml" />
</modules>
</component>
</project>

+ 15
- 0
src/Main.java View File

@@ -0,0 +1,15 @@
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
public static void main(String[] args) {
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
// to see how IntelliJ IDEA suggests fixing it.
System.out.printf("Hello and welcome!");

for (int i = 1; i <= 5; i++) {
//TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint
// for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>.
System.out.println("i = " + i);
}
}
}

+ 5
- 0
src/helloWorld.java View File

@@ -0,0 +1,5 @@
public class helloWorld {
public static void main (String[] args){
System.out.println("Hello World!");
}
}

+ 26
- 0
src/praktikum01/Zahlenfelder.java View File

@@ -0,0 +1,26 @@
package praktikum01;

public class Zahlenfelder {
public static void main(String[] args) {

for (int i = 1; i < 201; i++) {
// Wenn durch 5 Teilbar
if (i % 5 == 0) {
System.out.println(i + " - <Zahl> ist durch 5 Teilbar");
}
wennEndeGleichNeun(i);


}

}


public static void wennEndeGleichNeun(int i){
// Wenn Zahl auf 9 endet
if (i % 10 == 9) {
System.out.println(i + " - <Zahl> endet auf 9");
}
}
}


Loading…
Cancel
Save