• 第六小组作业


    计划:

    估计这个任务需要多少时间完成:5-6天

    开发:

    需求分析:作为一个排球记分员,我希望能够方便的记录分数(精确到每球的的分),以便及时的把分数反映给观众。

    设计文档:①排球计分程序的加减分②比赛结果的查询③比赛详细记录的查询

    具体设计:

    活动图:

    具体编写:

    详细得每场总比分:

    具体代码:

    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 WindowsFormsApplication1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private void jia1_Click(object sender, EventArgs e)
            {
               if(TBC.Text=="第一场")
               {
                if(int.Parse(TB1.Text)<25)
                {
                    int a = int.Parse(TB1.Text);
                    a++;
                    TB1.Text = a.ToString();
    
                    int c = int.Parse(TB2.Text);
                    if (a == 25 && a - 1 > c)
                    {
                        MessageBox.Show("第一场" + CB1.Text + "");
                        TBC.Text = "第二场";
                        TB1.Text = "0";
                        TB2.Text = "0";
                    }
                }
                else
                {
                    int a = int.Parse(TB1.Text);
                    a++;
                    TB1.Text = a.ToString();
                    int c = int.Parse(TB2.Text);
                    if (a - 1 > c)
                    {
                        MessageBox.Show("第一场" + CB1.Text + "");
                        TBC.Text = "第二场";
                        TB1.Text = "0";
                        TB2.Text = "0";
                    }
                }
              }
               else if (TBC.Text == "第二场")
               {
                   if (int.Parse(TB1.Text) < 25)
                   {
                       int a = int.Parse(TB1.Text);
                       a++;
                       TB1.Text = a.ToString();
                       int c = int.Parse(TB2.Text);
                       if (a == 25 && a - 1 > c)
                       {
                           MessageBox.Show("第二场" + CB1.Text + "");
                            TBC.Text = "第三场";
                            TB1.Text = "0";
                            TB2.Text = "0";
                       }
                   }
                   else
                   {
                       int a = int.Parse(TB1.Text);
                       a++;
                       TB1.Text = a.ToString();
                       int c = int.Parse(TB2.Text);
                       if (a - 1 > c)
                       {
                           MessageBox.Show("第二场" + CB1.Text + "");
                           TBC.Text = "第三场";
                           TB1.Text = "0";
                           TB2.Text = "0";
                       }
                   }
               }
               else if(TBC.Text=="第三场"){
                if (int.Parse(TB1.Text) < 25)
                {
                    int a = int.Parse(TB1.Text);
                    a++;
                    TB1.Text = a.ToString();
                    int c = int.Parse(TB2.Text);
                    if (a == 25 && a - 1 > c)
                    {
                        MessageBox.Show("第三场" + CB1.Text + "");
                        TBC.Text = "第四场";
                        TB1.Text = "0";
                        TB2.Text = "0";
                    }
                }
                else
                {
                    int a = int.Parse(TB1.Text);
                    a++;
                    TB1.Text = a.ToString();
                    int c = int.Parse(TB2.Text);
                    if (a - 1 > c)
                    {
                        MessageBox.Show("第三场" + CB1.Text + "");
                        TBC.Text = "第四场";
                        TB1.Text = "0";
                        TB2.Text = "0";
                    }
                }
            }
                else if(TBC.Text=="第四场"){
                if (int.Parse(TB1.Text) < 25)
                {
                    int a = int.Parse(TB1.Text);
                    a++;
                    TB1.Text = a.ToString();
                    int c = int.Parse(TB2.Text);
                    if (a == 25 && a - 1 > c)
                    {
                        MessageBox.Show("第四场" + CB1.Text + "");
                        TBC.Text = "第五场";
                        TB1.Text = "0";
                        TB2.Text = "0";
                    }
                }
                else
                {
                    int a = int.Parse(TB1.Text);
                    a++;
                    TB1.Text = a.ToString();
                    int c = int.Parse(TB2.Text);
                    if (a - 1 > c)
                    {
                        MessageBox.Show("第四场" + CB1.Text + "");
                        TBC.Text = "第五场";
                        TB1.Text = "0";
                        TB2.Text = "0";
                    }
                }
                }
               else if (TBC.Text == "第五场")
               {
                if (int.Parse(TB1.Text) < 25)
                {
                    int a = int.Parse(TB1.Text);
                    a++;
                    TB1.Text = a.ToString();
                    int c = int.Parse(TB2.Text);
                    if (a == 25 && a - 1 > c)
                    {
                        MessageBox.Show("第五场" + CB1.Text + "");
                        
                    }
                }
                else
                {
                    int a = int.Parse(TB1.Text);
                    a++;
                    TB1.Text = a.ToString();
                    int c = int.Parse(TB2.Text);
                    if (a - 1 > c)
                    {
                        MessageBox.Show("第五场" + CB1.Text + "");
                    } 
                }
                }
            }
    
            private void jia2_Click(object sender, EventArgs e)
            {
                if (TBC.Text == "第一场")
                {
                    if (int.Parse(TB2.Text) < 25)
                    {
                        int a = int.Parse(TB2.Text);
                        a++;
                        TB2.Text = a.ToString();
    
                        int c = int.Parse(TB1.Text);
                        if (a == 25 && a - 1 > c)
                        {
                            MessageBox.Show("第一场" + CB2.Text + "");
                            TB2.Text = "0";
                            TBC.Text = "第二场";
                            TB1.Text = "0";
                        }
                    }
    
                    else
                    {
                        int a = int.Parse(TB2.Text);
                        a++;
                        TB2.Text = a.ToString();
                        int c = int.Parse(TB1.Text);
                        if (a - 1 > c)
                        {
                            MessageBox.Show("第一场" + CB2.Text + "");
                            TBC.Text = "第二场";
                            TB2.Text = "0";
                            TB1.Text = "0";
                        }
                    }
                }
                else if(TBC.Text=="第二场")
                {
                if (int.Parse(TB2.Text) < 25)
                {
                    int a = int.Parse(TB2.Text);
                    a++;
                    TB2.Text = a.ToString();
                    int c = int.Parse(TB1.Text);
                    if (a == 25 && a - 1 > c)
                    {
                        MessageBox.Show("第二场" + CB2.Text + "");
                        TBC.Text = "第三场";
                        TB2.Text = "0";
                        TB1.Text = "0";
                    }
                }
                else
                {
                    int a = int.Parse(TB2.Text);
                    a++;
                    TB2.Text = a.ToString();
                    int c = int.Parse(TB1.Text);
                    if (a - 1 > c)
                    {
                        MessageBox.Show("第二场" + CB2.Text + "");
                        TBC.Text = "第三场";
                        TB2.Text = "0";
                        TB1.Text = "0";
                    }
                }
                }
                else if (TBC.Text == "第三场")
                {
                    if (int.Parse(TB2.Text) < 25)
                    {
                        int a = int.Parse(TB2.Text);
                        a++;
                        TB2.Text = a.ToString();
                        int c = int.Parse(TB1.Text);
                        if (a == 25 && a - 1 > c)
                        {
                            MessageBox.Show("第三场" + CB2.Text + "");
                            TBC.Text = "第四场";
                            TB2.Text = "0";
                            TB1.Text = "0";
                        }
                    }
                    else
                    {
                        int a = int.Parse(TB2.Text);
                        a++;
                        TB2.Text = a.ToString();
                        int c = int.Parse(TB1.Text);
                        if (a - 1 > c)
                        {
                            MessageBox.Show("第三场" + CB2.Text + "");
                            TBC.Text = "第四场";
                            TB2.Text = "0";
                            TB1.Text = "0";
                        }
                    }
                }
                else if(TBC.Text=="第四场"){
                if (int.Parse(TB2.Text) < 25)
                {
                    int a = int.Parse(TB2.Text);
                    a++;
                    TB2.Text = a.ToString();
                    int c = int.Parse(TB1.Text);
                    if (a == 25 && a - 1 > c)
                    {
                        MessageBox.Show("第四场" + CB2.Text + "");
                        TBC.Text = "第五场";
                        TB2.Text = "0";
                        TB1.Text = "0";
                    }
                }
                else
                {
                    int a = int.Parse(TB2.Text);
                    a++;
                    TB2.Text = a.ToString();
                    int c = int.Parse(TB1.Text);
                    if (a - 1 > c)
                    {
                        MessageBox.Show("第四场" + CB2.Text + "");
                        TBC.Text = "第五场";
                        TB2.Text = "0";
                        TB1.Text = "0";
                    }
                }
              }
                else if (TBC.Text == "第五场")
                {
                    if (int.Parse(TB2.Text) < 25)
                    {
                        int a = int.Parse(TB2.Text);
                        a++;
                        TB2.Text = a.ToString();
                        int c = int.Parse(TB1.Text);
                        if (a == 25 && a - 1 > c)
                        {
                            MessageBox.Show("第五场" + CB2.Text + "");
    
                        }
                    }
                    else
                    {
                        int a = int.Parse(TB2.Text);
                        a++;
                        TB2.Text = a.ToString();
                        int c = int.Parse(TB1.Text);
                        if (a - 1 > c)
                        {
                            MessageBox.Show("第五场" + CB2.Text + "");
    
                        }
                    }
                }
            }
    
            private void jian1_Click(object sender, EventArgs e)
            {
                if (TBC.Text == "第一场")
                {
                    if (int.Parse(TB1.Text) < 25)
                    {
                        int a = int.Parse(TB1.Text);
                       
                        TB1.Text = a.ToString();
    
                    }
                    else
                    { }
    
                }
                if (TBC.Text == " 第二场")
                {
    
                    if (int.Parse(TB1.Text) < 25)
                    {
                        int a = int.Parse(TB1.Text);
                        
                        TB1.Text = a.ToString();
    
                    }
                    else
                    { }
                }
                else if (TBC.Text == " 第三场")
                {
    
                    if (int.Parse(TB1.Text) < 25)
                    {
                        int a = int.Parse(TB1.Text);
                       
                        TB1.Text = a.ToString();
    
                    }
                }
                else if (TBC.Text == " 第四场")
                {
    
                    if (int.Parse(TB1.Text) < 25)
                    {
                        int a = int.Parse(TB1.Text);
                        
                        TB1.Text = a.ToString();
    
                    }
                }
                else if (TBC.Text == " 第五场")
                {
    
                    if (int.Parse(TB1.Text) < 25)
                    {
                        int a = int.Parse(TB1.Text);
                        
                        TB1.Text = a.ToString();
    
                    }
                }
            }
    
            private void jian2_Click(object sender, EventArgs e)
            {
                if (TBC.Text == "第一场")
                {
                    if (int.Parse(TB2.Text) < 25)
                    {
                        int a = int.Parse(TB2.Text);
                        a--;
                        TB2.Text = a.ToString();
    
                    }
    
                }
                else if (TBC.Text == " 第二场")
                {
    
                    if (int.Parse(TB2.Text) < 25)
                    {
                        int a = int.Parse(TB2.Text);
                       
                        TB2.Text = a.ToString();
    
                    }
    
                }
                else if (TBC.Text == " 第三场")
                {
    
                    if (int.Parse(TB2.Text) < 25)
                    {
                        int a = int.Parse(TB2.Text);
                       
                        TB2.Text = a.ToString();
    
                    }
    
                }
                else if (TBC.Text == " 第四场")
                {
    
                    if (int.Parse(TB2.Text) < 25)
                    {
                        int a = int.Parse(TB2.Text);
                        
                        TB2.Text = a.ToString();
    
    
    
                    }
                }
                else if (TBC.Text == " 第五场")
                {
    
                    if (int.Parse(TB2.Text) < 25)
                    {
                        int a = int.Parse(TB2.Text);
                        
                        TB2.Text = a.ToString();
    
                    }
    
                }
            }
    
            private void Form1_Load(object sender, EventArgs e)
            {
    
            }
        }
    }

    还没有测试。

  • 相关阅读:
    【摘】IIS修复工具,怎么完全卸载IIS
    开启@yahoo.cn邮箱POP和SMTP的方法
    IT男士专用餐单(养生)
    使用wxWidgets编程——第一步
    搭建跨平台编程环境Code::Blocks+wxWidgets
    TANGO是一个开源的分布控制系统
    【摘】在Window下右键方式打开Dos命令窗口右键菜单支持DOS命令提示符号
    【原】美是永远的追求
    flascc移植问题流水账
    战棋游戏三国志英杰传分析
  • 原文地址:https://www.cnblogs.com/chen-bo/p/6220818.html
Copyright © 2020-2023  润新知