File tree Expand file tree Collapse file tree 1 file changed +18
-18
lines changed
Expand file tree Collapse file tree 1 file changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -4,29 +4,29 @@ public class Exercise {
44
55 public static void main (String [] args ) {
66
7- @ SuppressWarnings ("resource" )
8- Scanner scanner = new Scanner (System .in );
7+ @ SuppressWarnings ("resource" )
8+ Scanner scanner = new Scanner (System .in );
99
10- int k ;
11- double p ;
10+ int k ;
11+ double p ;
1212
13- boolean loop ;
14- do {
15- System .out .print ("Gib bitte das Startkapital ein (in Euro): " );
16- k = scanner .nextInt ();
13+ boolean loop ;
14+ do {
15+ System .out .print ("Gib bitte das Startkapital ein (in Euro): " );
16+ k = scanner .nextInt ();
1717
18- System .out .print ("Gib bitte den Prozentsatz ein: " );
19- p = scanner .nextDouble ();
18+ System .out .print ("Gib bitte den Prozentsatz ein: " );
19+ p = scanner .nextDouble ();
2020
21- System .out .println ("Ergebnis: Der Jahreszins betraegt " + (int ) calculateInterestPerAnnum (k , p ) + " Euro" );
22-
23- System .out .print ("Willst Du einen weiteren Jahreszins berechnen (true, false)?: " );
24- loop = scanner .nextBoolean ();
25- } while (loop );
21+ System .out .println (
22+ "Ergebnis: Der Jahreszins betraegt " + (int ) calculateInterestPerAnnum (k , p ) + " Euro" );
2623
24+ System .out .print ("Willst Du einen weiteren Jahreszins berechnen (true, false)?: " );
25+ loop = scanner .nextBoolean ();
26+ } while (loop );
2727 }
2828
29- static double calculateInterestPerAnnum (int k , double p ) {
30- return k * p / 100 ;
31- }
29+ static double calculateInterestPerAnnum (int k , double p ) {
30+ return k * p / 100 ;
31+ }
3232}
You can’t perform that action at this time.
0 commit comments