java课程设计

•团队课程设计博客链接

http://www.cnblogs.com/toonaive/p/7063362.html

•个人负责模块或任务说明

购买:用户登录后购买选定的彩票
主菜单:整个彩票销售系统的主菜单
博客报告

•自己的代码提交记录截图

1109858-20170622153717710-355955221.png

•自己负责模块或任务详细说明

购买和时间模块重要代码

 public   int[] buyl(){
    int[] num=new int[7];
    boolean cs=true;
    System.out.println("请选择手动选号还是随机选号");
    System.out.println("----1.手动选号--------");
    System.out.println("----2.随机选号--------");
    Scanner a=new Scanner(System.in);
    int m=a.nextInt();
    if(m==1){
        System.out.println("输入你所购买的彩票,用','隔开");
        while(cs){
        sc=new Scanner (System.in);
        String str1=sc.next();
        String[] str2 = str1.split(",");
        for(int i=0;i<str2.length;i++){
            num[i]=Integer.parseInt(str2[i]);
        }
        if(str2.length<7)
        System.out.println("输入错误,彩票数字应该为7位,请重新输入");
        
        if(str2.length==7){
        System.out.println("购买成功");
        cs=false;
        }
        }
    }
    if(m==2){
        System.out.println("你随机选的号码为:");
         final int N = 36;
          final int M = 7;
          int selected[] = new int[N];//用来记得每次选的数字表格
          int cnt = 0;// 已选的数字个数
          while (cnt < M) {
           int n = (int) (Math.random() * N) + 1;
           boolean find = false;
           for (int i = 0; i < cnt; i++) {
            if (selected[i] == n)  {
             find = true;
             break;
            }
           }
           if (!find) {//表示选的n是不重复的
            selected[cnt] = n;
            cnt++;
           }
          }
          for(int i=0;i<M;i++)//打印每次选择的数字
           System.out.print(selected[i]+" ");     
        }
        return num;
         
        
         
         
    }
//时间
public String buyday(){
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    String strDate = sdf.format(new Date());
    return strDate;
    }

1109858-20170623082242335-1898393893.png
1109858-20170623082247804-1912879600.png

•课程设计感想

首次进行多人合作的程序设计,在协同上还存在各种问题和麻烦,对团队Git功能使用的不熟悉,导致进程同步花费了大量时间
代码在过去已有的作业上进行改进,加入GUI界面和数据库等功能。虽然出现了各种问题,但是依靠网络和调试,基本解决了程序运行的
各种问题,和编程上各人存在的偏差

转载于:https://www.cnblogs.com/toonaive/p/7063378.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值