SHOW:
|
|
- or go back to the newest paste.
1 | import java.util.Random; | |
2 | ||
3 | ||
4 | public class Geld { | |
5 | ||
6 | - | public static int[] geld = new int[8]; |
6 | + | private static int[] geld = new int[8]; |
7 | - | static int n = 5; |
7 | + | private static int n = 5; |
8 | - | static Random rand = new Random(); |
8 | + | private static Random rand = new Random(); |
9 | ||
10 | public static int[] getGeld() { | |
11 | return geld; | |
12 | } | |
13 | ||
14 | ||
15 | public static int[] zahlung() { | |
16 | ||
17 | ||
18 | for ( int i=0; i < geld.length; i++) { | |
19 | ||
20 | geld[i] = rand.nextInt(n); | |
21 | ||
22 | } | |
23 | ||
24 | return geld; | |
25 | ||
26 | ||
27 | } | |
28 | ||
29 | public static float[] zusammenzaehlen(int[] zahl){ | |
30 | float[] geldfloat = new float[8]; | |
31 | ||
32 | ||
33 | for ( int i=0; i < geldfloat.length; i++) { | |
34 | geldfloat[i]=zahl[i]; | |
35 | ||
36 | } | |
37 | return geldfloat; | |
38 | } | |
39 | } |