-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fusion.java
104 lines (102 loc) · 1.7 KB
/
Fusion.java
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import java.util.*;
import java.lang.*;
public class Fusion extends Companies
{
private int counts;
private static final int max=25;
private int stocksLeft;
public Fusion()
{
counts=0;
stocksLeft=25;
}
public int getCounts()
{
return counts;
}
public void setCounts(int x)
{
counts = x;
}
public int getStocksLeft()
{
return stocksLeft;
}
public int getMajorityBonus()
{
if(counts>=41)
return 11000;
else if(counts>=31)
return 10000;
else if(counts>=21)
return 9000;
else if(counts>=11)
return 8000;
else if(counts>=6)
return 7000;
else if(counts==5)
return 6000;
else if(counts==4)
return 5000;
else if(counts==3)
return 4000;
else if(counts==2)
return 3000;
else
return 0;
}
public int getMinorityBonus()
{
if(counts>=41)
return 5500;
else if(counts>=31)
return 5000;
else if(counts>=21)
return 4500;
else if(counts>=11)
return 4000;
else if(counts>=6)
return 3500;
else if(counts==5)
return 3000;
else if(counts==4)
return 2500;
else if(counts==3)
return 2000;
else if(counts==2)
return 1500;
else
return 0;
}
public int getPrice()
{
if(counts>=41)
return 1100;
else if(counts>=31)
return 1000;
else if(counts>=21)
return 900;
else if(counts>=11)
return 800;
else if(counts>=6)
return 700;
else if(counts==5)
return 600;
else if(counts==4)
return 500;
else if(counts==3)
return 400;
else if(counts==2)
return 300;
else
return 0;
}
public void changeCounts(int x)
{
counts+=x;
}
public void changeStocksLeft(int x)
{
stocksLeft+=x;
}
}