-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRandomNumbers2.java
More file actions
42 lines (33 loc) · 1.17 KB
/
RandomNumbers2.java
File metadata and controls
42 lines (33 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
public class RandomNumbers2
{
public static void main( String[] args )
{
int a, b, c, d, e, low, high;
a = 1 + (int)(Math.random()*10);
b = 1 + (int)(Math.random()*10);
c = 1 + (int)(Math.random()*10);
d = 1 + (int)(Math.random()*10);
e = 1 + (int)(Math.random()*10);
System.out.println( a + "\t" + b + "\t" + c + "\t" + d + "\t" + e );
a = 1 + (int)(Math.random()*100);
b = 1 + (int)(Math.random()*100);
c = 1 + (int)(Math.random()*100);
d = 1 + (int)(Math.random()*100);
e = 1 + (int)(Math.random()*100);
System.out.println( a + "\t" + b + "\t" + c + "\t" + d + "\t" + e );
a = 70 + (int)(Math.random()*31);
b = 70 + (int)(Math.random()*31);
c = 70 + (int)(Math.random()*31);
d = 70 + (int)(Math.random()*31);
e = 70 + (int)(Math.random()*31);
System.out.println( a + "\t" + b + "\t" + c + "\t" + d + "\t" + e );
low = 70;
high = 100;
a = low + (int)(Math.random()*(high-low+1));
b = low + (int)(Math.random()*(high-low+1));
c = low + (int)(Math.random()*(high-low+1));
d = low + (int)(Math.random()*(high-low+1));
e = low + (int)(Math.random()*(high-low+1));
System.out.println( a + "\t" + b + "\t" + c + "\t" + d + "\t" + e );
}
}