This commit is contained in:
DH10RBH 2024-04-17 11:58:05 +02:00
parent 186872ad58
commit c03543b334
7 changed files with 111 additions and 0 deletions

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
Kontrollstrukturen/afg4 zinsen/.idea/.gitignore generated vendored Normal file
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

View File

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

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$/afg4 zinsen.iml" filepath="$PROJECT_DIR$/afg4 zinsen.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

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>

View File

@ -0,0 +1,43 @@
public class Main {
public static void main(String[] args) {
float startwert = 23550.5F;
int laufzeit = 10;
float zinssatz1, zinssatz2, zinssatz3;
zinssatz1 = 2.3F;
zinssatz2 = 0.5F;
zinssatz3 = 1.0F;
float haben1 = startwert;
float haben2 = startwert;
float haben3 = startwert;
for (int i=1; i <= laufzeit; i++){
haben1 = (haben1 + haben1*(zinssatz1/100));
System.out.println("Nach " + i + " Jahren beträgt das Haben mit Zinssatz1: " + haben1 + " Euro.");
}
System.out.println("==============================================");
for (int i=1; i <= laufzeit; i++){
haben2 = (haben2 + haben2*(zinssatz2/100));
System.out.println("Nach " + i + " Jahren beträgt das Haben mit Zinssatz2: " + haben2 + " Euro.");
}
System.out.println("==============================================");
for (int i=1; i <= laufzeit; i++){
haben3 = (haben3 + haben3*(zinssatz3/100));
System.out.println("Nach " + i + " Jahren beträgt das Haben mit Zinssatz3: " + haben3 + " Euro.");
}
}
}