博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
排球比赛积分规则---三层架构
阅读量:6236 次
发布时间:2019-06-22

本文共 2508 字,大约阅读时间需要 8 分钟。

估计这个任务需要多少时间:3天

 需求分析:0.5h

 用户故事:作为一名现场记分员,我希望详细记录比赛现场比分增长情况,以便观众及运动员、教练员及时掌握比赛状况。

 生成设计文档3h

 设计复审(和同事审核设计文档)0.5h

 代码规范(为目前的开发制定合适的规范)

 具体代码:3h

代码具体如下:

using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace 排球计分程序

{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            
        }
        int a = 1;
        int b = 1;
        int i = 1;
        private void btnD1_Click(object sender, EventArgs e)
        {
            int D1 = Convert.ToInt32(txtD1.Text);
            int D2 = Convert.ToInt32(txtD2.Text);
            int DD1 = Convert.ToInt32(txtDD1.Text);
            int DD2 = Convert.ToInt32(txtDD2.Text);
            txtD1.Text = (a++).ToString();
            if (D1 >= 24 && (D1 - D2) > 1)
            {
                txtDD1.Text = (Convert.ToInt32(txtDD1.Text) + 1).ToString();
                txtD1.Text = "0";
                txtD2.Text = "0";
                txtCount.Text += "第" + (i++) + "局:" + txtDD1.Text + ":" + txtDD2.Text + "\r\n";
                a = 1;
                if (txtDD1.Text == "3")
                {
                    MessageBox.Show("一队胜利");
                    txtD1.Text = "0";
                    txtDD1.Text = "0";
                    txtD2.Text = "0";
                    txtDD2.Text = "0";
                    txtCount.Clear();
                }
            }
            if (DD1 + DD2 > 3)
            {
                if (D1 >= 14 && (D1 - D2) > 1)
                {
                    txtDD1.Text = (Convert.ToInt32(txtDD1.Text) + 1).ToString();
                    txtD1.Text = "0";
                    txtD2.Text = "0";
                    txtCount.Text += "第" + (i++) + "局:" + txtDD1.Text + ":" + txtDD2.Text + "\r\n";
                    a = 1;
                    if (txtDD1.Text == "3")
                    {
                        MessageBox.Show("二队胜利");
                        txtD1.Text = "0";
                        txtDD1.Text = "0";
                        txtD2.Text = "0";
                        txtDD2.Text = "0";
                        txtCount.Clear();
                        i = 1;
                    }
                }
            }
        }

        private void btnD2_Click(object sender, EventArgs e)

        {
            
            int D1 = Convert.ToInt32(txtD1.Text);
            int D2 = Convert.ToInt32(txtD2.Text);
            int DD1 = Convert.ToInt32(txtDD1.Text);
            int DD2 = Convert.ToInt32(txtDD2.Text);
            txtD2.Text = (b++).ToString();
            if (D2>= 24&&(D2-D1 )>1)
            {
                txtDD2.Text = (Convert.ToInt32(txtDD2.Text) + 1).ToString();
                txtD1.Text = "0";
                txtD2.Text = "0";
                txtCount.Text += "第" + (i++)+ "局:" + txtDD1.Text + ":" + txtDD2.Text + "\r\n";
                b= 1;
                if (txtDD2.Text=="3")
                {
                    MessageBox.Show("一队胜利");
                    txtD1.Text = "0";
                    txtDD1.Text = "0";
                    txtD2.Text = "0";
                    txtDD2.Text = "0";
                    txtCount.Clear();
                }
            }
            if(DD1+DD2>3)
            {
                if (D2 >= 14 && (D2 - D1) > 1)
                {
                    txtDD2.Text = (Convert.ToInt32(txtDD2.Text) + 1).ToString();
                    txtD1.Text = "0";
                    txtD2.Text = "0";
                    txtCount.Text += "第" + (i++) + "局:" + txtDD1.Text + ":" + txtDD2.Text + "\r\n";
                    b = 1;
                    if (txtDD2.Text == "3")
                    {
                        MessageBox.Show("二队胜利");
                        txtD1.Text = "0";
                        txtDD1.Text = "0";
                        txtD2.Text = "0";
                        txtDD2.Text = "0";
                        txtCount.Clear();
                        i = 1;
                    }
                }
            }
           
        }

       

      
    }

转载于:https://www.cnblogs.com/zhang123456789/p/6569077.html

你可能感兴趣的文章
Java数据结构与算法(28) - ch13图(广度优先搜索)
查看>>
关系型数据库和非关系型数据库的简单对比
查看>>
在按钮上添加倒计时激活功能(转自手册网)
查看>>
java 线程学习。
查看>>
更改系统内核版本
查看>>
K8s和docker的使用
查看>>
C# 指针操作图像 二值化处理
查看>>
docker中出现容器未运行无法进入容器的操作
查看>>
TCP/UDP
查看>>
Selenium学习(9) 测试模型
查看>>
【机器学习】--FP-groupth算法从初始到应用
查看>>
WPF几个核心类的类层次结构
查看>>
浏览器访问设备出现白条
查看>>
可变参数
查看>>
关于最近学习出现的错误,及解决的想法
查看>>
「SP122」STEVE - Voracious Steve 解题报告
查看>>
图片压缩上传
查看>>
Spark RDD Transformation 简单用例(一)
查看>>
蓝色光标拟增发700万股
查看>>
C/C++一个容易犯的低级错误--分号引起的错误
查看>>