首页 > 代码库 > 十五周作业
十五周作业
计划 | |
估计要用多长时间 | 7天 |
需求分析 | 1h |
生成设计文档 | 1h |
设计复审 | 40min |
代码规范 | 20min |
具体设计 | 40min |
具体编码 | 5天 |
代码复审 | 1h |
测试 | 50min |
测试报告 | 10min |
计算工作量 | 25min |
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 ,b,i= 1;
private void btnH_Click(object sender, EventArgs e)
{
int H = Convert.ToInt32(txtH.Text);
int L = Convert.ToInt32(txtL.Text);
int H1 = Convert.ToInt32(txtH1.Text);
int L1 = Convert.ToInt32(txtL1.Text);
txtH.Text = (a++).ToString();
if (H >= 24 && (H - L) > 1)
{
txtH1.Text = (Convert.ToInt32(txtH1.Text) + 1).ToString();
txtH.Text = "0";
txtL.Text = "0";
txtCount.Text += "第" + (i++) + "局:" + txtH1.Text + ":" + txtL1.Text;
a = 1;
if (txtH1.Text == "3")
{
MessageBox.Show("A队胜利");
txtH.Text = "0";
txtH1.Text = "0";
txtL.Text = "0";
txtL1.Text = "0";
txtCount.Clear();
}
}
if (H1 + L1 > 3)
{
if (H >= 14 && (H - L) > 1)
{
txtH1.Text = (Convert.ToInt32(txtH1.Text) + 1).ToString();
txtH.Text = "0";
txtL.Text = "0";
txtCount.Text += "第" + (i++) + "局:" + txtH1.Text + ":" + txtL1.Text ;
a = 1;
if (txtH1.Text == "3")
{
MessageBox.Show("A队胜利");
txtH.Text = "0";
txtH1.Text = "0";
txtL.Text = "0";
txtL1.Text = "0";
txtCount.Clear();
i = 1;
}
}
}
}
private void btnL_Click(object sender, EventArgs e)
{
int H = Convert.ToInt32(txtH.Text);
int L = Convert.ToInt32(txtL.Text);
int H1 = Convert.ToInt32(txtH1.Text);
int L1 = Convert.ToInt32(txtL1.Text);
txtL.Text = (b++).ToString();
if (L>= 24&&(L-H )>1)
{
txtL1.Text = (Convert.ToInt32(txtL1.Text) + 1).ToString();
txtH.Text = "0";
txtL.Text = "0";
txtCount.Text += "第" + (i++)+ "局:" + txtH1.Text + ":" + txtL1.Text;
b= 1;
if (txtL1.Text=="3")
{
MessageBox.Show("B队胜利");
txtH.Text = "0";
txtH1.Text = "0";
txtL.Text = "0";
txtL1.Text = "0";
txtCount.Clear();
}
}
if(H1+L1>3)
{
if (L >= 14 && (L - H) > 1)
{
txtL1.Text = (Convert.ToInt32(txtL1.Text) + 1).ToString();
txtH.Text = "0";
txtL.Text = "0";
txtCount.Text += "第" + (i++) + "局:" + txtH1.Text + ":" + txtL1.Text;
b = 1;
if (txtL1.Text == "3")
{
MessageBox.Show("B队胜利");
txtH.Text = "0";
txtH1.Text = "0";
txtL.Text = "0";
txtL1.Text = "0";
txtCount.Clear();
i = 1;
}
}
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
十五周作业