资源简介
这个彩票抽奖系统 适用于初学者 因为初学者都是在一些软件上运作比如MyEclipse等
可操作性强 运作时在控制台是一个友好的界面

代码片段和文件信息
package com.mstanford.lotery_system.common;
import com.mstanford.lotery_system.lottery.*;
//双色球
public class Shuanseqiu {
static final String START=“01“;
static final String LEND=“16“;
static final String HEND=“33“;
int i;
int []r=new int[6];
//判断前6个数是否合法
public String checkNumber(String numberString max){
String numbers=““;
if(number.length()!=2){
return null;
}
else{
if(number.compareTo(START)<0||number.compareTo(max)>0){
return null;
}
else{
numbers=numbers+number+““;
}
}
return numbers;
}
//判断最后一个数是否合法
public boolean checkLast(String number){
if(checkNumber(numberLEND)==null){
return false;
}
else{
return true;
}
}
//判断数组中是否有重复的数
public boolean checkEquals(String []strArryint length){
for(int i=0;i for(int j=0;j if(strArry[i].equals(strArry[j])){
return false;
}
}
}
return true;
}
//产生中奖号,并升序排列
public String []getWinningNumber(Order orderArryIntToString ais){
for(i=0;i<6;i++){
r[i]=(int)(Math.random()*33+1);
compare();
}
r=order.orderAsc(r);
String []six=ais.intToString(r);
String []seven=new String[7];
int sev=(int)(Math.random()*16+1);
if(sev<10){
seven[6]=“+0“+String.valueOf(sev);
}
else{
seven[6]=“+“+String.valueOf(sev);
}
for(int i=0;i seven[i]=six[i];
}
return seven;
}
//除去重复的数
public void compare(){
for(int j=0;j if(r[j]==r[i]){
r[i]=(int)(Math.random()*33+1);
compare();
}
}
}
//中奖的情况
public String prize(String[]winString []buy){
StringBuffer winner=new StringBuffer();
String rank=““;
int befordsix=0;
int last=0;
for(int i=0;i for(int j=0;j if(buy[j].trim().equals(win[i].trim())){
befordsix++;
winner=winner.append(buy[j]+“ “);
}
}
}
if(buy[6].equals(win[6])){
last=1;
winner=winner.append(buy[6]);
}
//判断中几等奖
switch(befordsix){
case 6:
if(last==1){
rank=“6+1: 一等奖!“;
}
else{
rank=“6+0:二等奖!“;
}
break;
case 5:
if(last==1){
rank=“5+1:三等奖!“;
}
else{
rank=“5+0:四等奖!“;
}
break;
case 4:
if(last==1){
rank=“4+1: 四等奖!“;
}
else{
rank=“4+0:五等奖!“;
}
break;
case 3:
if(last==1){
rank=“3+1: 五等奖!“;
}
else{
rank=“3+0:没有中奖!“;
}
break;
case 2:
if(last==1){
rank=“2+1: 六等奖!“;
}
else{
rank=“2+0:没有中奖!“;
}
break;
case 1:
if(last==1){
rank=“1+1:七等奖!“;
}
else{
rank=“1+0:没有中奖!“;
}
break;
case 0:
if(last==1){
rank=“0+1: 七等奖!“;
}
else{
rank=“0+0:没有中奖!“;
}
break;
}
winner.append(““);
winner.append(rank);
return winner.toString();
}
//验证用户输入的前六个数是否合法
public String[] buyL
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-01-07 22:02 彩票抽奖系统\
文件 232 2011-12-04 15:36 彩票抽奖系统\.classpath
文件 394 2011-12-04 15:36 彩票抽奖系统\.project
文件 14133 2011-12-21 19:42 彩票抽奖系统\java.txt
目录 0 2012-01-07 22:02 彩票抽奖系统\src\
目录 0 2012-01-07 22:02 彩票抽奖系统\src\com\
目录 0 2012-01-07 22:02 彩票抽奖系统\src\com\mstanford\
目录 0 2012-01-07 22:02 彩票抽奖系统\src\com\mstanford\lotery_system\
目录 0 2012-01-07 22:02 彩票抽奖系统\src\com\mstanford\lotery_system\common\
文件 3861 2011-12-07 10:42 彩票抽奖系统\src\com\mstanford\lotery_system\common\Shuanseqiu.java
文件 2669 2011-12-08 11:06 彩票抽奖系统\src\com\mstanford\lotery_system\common\TwentyTwo_Five.java
目录 0 2012-01-07 22:02 彩票抽奖系统\src\com\mstanford\lotery_system\lottery\
文件 325 2011-12-06 14:21 彩票抽奖系统\src\com\mstanford\lotery_system\lottery\ArryIntToString.java
文件 285 2011-12-04 21:47 彩票抽奖系统\src\com\mstanford\lotery_system\lottery\Order.java
目录 0 2012-01-07 22:02 彩票抽奖系统\src\com\mstanford\lotery_system\util\
文件 3395 2011-12-13 22:40 彩票抽奖系统\src\com\mstanford\lotery_system\util\Process.java
文件 6498 2011-12-14 10:35 彩票抽奖系统\src\com\mstanford\lotery_system\util\Test.java
目录 0 2012-01-07 22:02 彩票抽奖系统\bin\
目录 0 2012-01-07 22:02 彩票抽奖系统\bin\com\
目录 0 2012-01-07 22:02 彩票抽奖系统\bin\com\mstanford\
目录 0 2012-01-07 22:02 彩票抽奖系统\bin\com\mstanford\lotery_system\
目录 0 2012-01-07 22:02 彩票抽奖系统\bin\com\mstanford\lotery_system\common\
文件 3713 2012-01-06 20:52 彩票抽奖系统\bin\com\mstanford\lotery_system\common\TwentyTwo_Five.class
文件 4563 2012-01-06 20:52 彩票抽奖系统\bin\com\mstanford\lotery_system\common\Shuanseqiu.class
目录 0 2012-01-07 22:02 彩票抽奖系统\bin\com\mstanford\lotery_system\lottery\
文件 542 2012-01-06 20:52 彩票抽奖系统\bin\com\mstanford\lotery_system\lottery\Order.class
文件 848 2012-01-06 20:52 彩票抽奖系统\bin\com\mstanford\lotery_system\lottery\ArryIntToString.class
目录 0 2012-01-07 22:02 彩票抽奖系统\bin\com\mstanford\lotery_system\util\
文件 5566 2012-01-06 20:52 彩票抽奖系统\bin\com\mstanford\lotery_system\util\Test.class
文件 4193 2012-01-06 20:52 彩票抽奖系统\bin\com\mstanford\lotery_system\util\Process.class
相关资源
- jsonarray所必需的6个jar包.rar
- JSP企业人事管理系统设计(源代码+论
- 三角网构TIN生成算法,Java语言实现
- java代码编写将excel数据导入到mysql数据
- Java写的cmm词法分析器源代码及javacc学
- JAVA JSP公司财务管理系统 源代码 论文
- JSP+MYSQL旅行社管理信息系统
- 推荐算法的JAVA实现
- 基于Java的酒店管理系统源码(毕业设
- java-图片识别 图片比较
- android毕业设计
- android-support-v4.jar已打包进去源代码
- java23种设计模式+23个实例demo
- java Socket发送/接受报文
- JAVA828436
- java界面美化 提供多套皮肤直接使用
- 在线聊天系统(java代码)
- 基于Java的图书管理系统807185
- java中实现将页面数据导入Excel中
- java 企业销售管理系统
- java做的聊天系统(包括正规课程设计
- Java编写的qq聊天室
- 商店商品管理系统 JAVA写的 有界面
- JAVA开发聊天室程序
- 在linux系统下用java执行系统命令实例
- java期末考试试题两套(答案) 选择(
- JAVA3D编程示例(建模、交互)
- Java 文件加密传输
- java做的房产管理系统
- 基于jsp的bbs论坛 非常详细
评论
共有 条评论