1、计划:半月
2、需求分析
用户故事:作为一个观众,我希望了解某一场比赛的比分,以便了解赛况。(满意条件:精确到每一局的结果比分)。
3、生成设计文档:
4、设计复审:三个小时
5、代码规范 无
6、具体编码:
namespace 排球计分程序
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int a = 0;
int b = 0;
int i = 1;
private void btnH_Click(object sender, EventArgs e)
{
int H = Convert.ToInt32(txtH.Text);
int L = Convert.ToInt32(txtL.Text);
H++;
txtH.Text= H.ToString();
if (i < 5)
{
if (H >= 25 && (H - L) >= 2)
{
a++;
txtH.Text = "0";
txtL.Text = "0";
txtCount.Text += "第" + i + "局:" + a + ":" + b + "
";
i++;
}
}
else if(i==5)
{
if (H >= 15 && (H - L) >= 2)
{
a++;
txtH.Text = "0";
txtL.Text = "0";
txtCount.Text += "第" + i + "局:" + a + ":" + b + "
";
}
}
if (a == 3)
{
MessageBox.Show("A队胜利");
txtH.Text = "0";
a = 0;
txtL.Text = "0";
b = 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);
L++;
txtL.Text = L.ToString();
if (i < 5)
{
if (L >= 25 && (L - H) >= 2)
{
b++;
txtH.Text = "0";
txtL.Text = "0";
txtCount.Text += "第" + i + "局:" + a + ":" + b + "
";
i++;
}
}
else if (i == 5)
{
if (L >= 15 && (L - H) >= 2)
{
b++;
txtH.Text = "0";
txtL.Text = "0";
txtCount.Text += "第" + i + "局:" + a + ":" + b + "
";
}
}
if (b == 3)
{
MessageBox.Show("B队胜利");
txtH.Text = "0";
a = 0;
txtL.Text = "0";
b = 0;
txtCount.Clear();
i = 1;
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
7、代码复审:30min
8、测试:无
9、报告
测试报告:30min
计算工作量:15天
事后总结:
有的功能还没有实现,数据库连接还是出现问题。