序号
奖品名称
奖品编号
抽到的概率
1
再来一次
P1
0.2
2
本站VIP一年
P2
0.1
3
谢谢参与
P3
0.4
4
50金币
P4
0.3
5
Iphone 6
P5
0.0
6
Ipad Air2
P6
-0.1
7
100元手机话费
P7
0.008
数据很简单,那么就直接看代码了
/**
* 奖品类
* @author:rex
* @date:2014年10月20日
* @version:1.0
*/
public class Gift {
private int index;
private String gitfId;
private String giftName;
private double probability;
public Gift(int index, String gitfId, String giftName, double probability) {
this.index = index;
this.gitfId = gitfId;
this.giftName = giftName;
this.probability = probability;
}
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
public String getGitfId() {
return gitfId;
}
public void setGitfId(String gitfId) {
this.gitfId = gitfId;
}
public String getGiftN