第16周总结(排球计分程序)

排球计分程序:

一,设计
    估计这个任务需要多少时间     八天。

二,开发

   1,需求分析---》拆成任务,编写代码

   这次作业是关于排球比赛计分程序,从排球比赛爱好着出发,希望每一个排球观众都能更好的了解比赛得分。
   作为一个排球爱好者,我希望知道排球比赛的得分,以便更好的掌握比赛得分。

   任务:a,作为排球爱好者需要知道每场A,B两队的得分;
            b,需要知道两个队每局累加得分;
            c,两队比分哪一队胜出,怎么表示出来;

  2,生成设计文档

  (类图)因为没有连接数据库,所以没有画类图。

  3,设计复审      三个小时

  4,代码规范     无

  5,具体设计  活动图

通过选择第几场比赛,每局比分处会出现每队的比分,在累加分处会出现每个局的比分和,
在总比分处,哪个队获胜,哪队下面会出现加1分。然而,当你在点击第一场时,它只会出现每局比分,其他的累加分,总比分不会变。

(本来事想连数据库的,但是,在连数据库时,出现好多问题,所以就放弃了,果断选择这个程序。)

6,(a)具体代码(编码)    一天

int sumA = 0;
int sumB = 0;
Boolean i = true;
Boolean j = true;
Boolean m = true;
Boolean n = true;
Boolean o = true;
int shengchang = 0;
int bshengchang = 0;

private void cmb1_SelectedValueChanged(object sender, EventArgs e)
{

if (this.cmb1.Text.Equals("第一场")) {

this.txt1.Text = "26";
this.txt2.Text = "24";
if (i)
{
int a = int.Parse(txt1.Text);
int b = int.Parse(txt2.Text);
sumA += a;
sumB += b;
this.sumGrade(sumA, sumB);
i = false;
if (a > b) {
shengchang++;
this.textBox3.Text = shengchang.ToString();
}
else if (a < b) {
bshengchang++;
this.textBox4.Text = bshengchang.ToString();
}
}

}
else if (this.cmb1.Text.Equals("第二场"))
{
this.txt1.Text = "25";
this.txt2.Text = "27";


if (j) {
int a = int.Parse(txt1.Text);
int b = int.Parse(txt2.Text);
sumA += a;
sumB += b;
this.sumGrade(sumA, sumB);
j = false;
if (a > b) {
shengchang++;
this.textBox3.Text = shengchang.ToString();
}
else if (a < b)
{
bshengchang++;
this.textBox4.Text = bshengchang.ToString();

}
}
}
else if (this.cmb1.Text.Equals("第三场"))
{
this.txt1.Text = "27";
this.txt2.Text = "23";
if (m) {
int a = int.Parse(txt1.Text);
int b = int.Parse(txt2.Text);
sumA += a;
sumB += b;
this.sumGrade(sumA, sumB);
m = false;
if (a > b) {
shengchang++;
this.textBox3.Text = shengchang.ToString();
}
else if (a < b)
{
bshengchang++;
this.textBox4.Text = bshengchang.ToString();
}
}
}

else if (this.cmb1.Text.Equals("第四场"))
{
this.txt1.Text = "24";
this.txt2.Text = "26";
if (n)
{
int a = int.Parse(txt1.Text);
int b = int.Parse(txt2.Text);
sumA += a;
sumB += b;
this.sumGrade(sumA, sumB);
n = false;
if (a > b)
{
shengchang++;
this.textBox3.Text = shengchang.ToString();
}
else if (a < b)
{
bshengchang++;
this.textBox4.Text = bshengchang.ToString();
}
}
}
else if (this.cmb1.Text.Equals("第五场"))
{
this.txt1.Text = "15";
this.txt2.Text = "13";
if (o)
{
int a = int.Parse(txt1.Text);
int b = int.Parse(txt2.Text);
sumA += a;
sumB += b;
this.sumGrade(sumA, sumB);
o = false;
if (a > b)
{
shengchang++;
this.textBox3.Text = shengchang.ToString();
}
else if (a < b)
{
bshengchang++;
this.textBox4.Text = bshengchang.ToString();
}
}
}



}
public void sumGrade(int a,int b) {
this.textBox1.Text = a.ToString();
this.textBox2.Text = b.ToString() ;
}

private void button1_Click(object sender, EventArgs e)
{
sumA = 0;
sumB = 0;
i = true;
j = true;
m = true;
n = true;
o = true;
shengchang = 0;
bshengchang = 0;
this.textBox1.Text = "";
this.textBox2.Text = "";
this.textBox3.Text = "";
this.textBox4.Text = "";
this.txt1.Text = "";
this.txt2.Text = "";
this.cmb1.Text = "";
}

  6, (b)界面设计

   (c)运行程序

7,代码复审   两个小时

8,测试

 (测试用例)(具体测试还做完)

三,报告

1,测试报告        半小时

2, 计算工作量      无

3,总结

这个程序还有很多buy,而且,有的代码还是不太懂,还需要同学的帮助,还是C#基础没学好,

还有很多不足,需要多多学习,不过,我会继续努力的。

 

原文地址:https://www.cnblogs.com/1383817277a/p/6214492.html