本周作业

 

对 排球积分器的设计   规划  编辑  制作:

 

  项目计划表:

 

 

 

 

软件计划:

 

预计用时:

230mn

预计开发用时:

100min

需求调查:

10min

生成文档:

5min

设计复审:

5min

代码规范:

5min

外观设计:

10min

具体代码编码:

100min

代码复审:

15min

软件测试:

40min

报告:

15min

测试报告:

5min

计算工作量:

5min

事后进行总结并改进:

5min

 

 

点击得分按钮显示得分情况与每一局后的比分:

用例图:

 

 

 代码:

namespace 排球计分器
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int m = 1;

private void button1_Click(object sender, EventArgs e)
{
int a1 = int.Parse(txta1.Text);
int a2 = int.Parse(txta2.Text);
int b1 = int.Parse(txtb1.Text);
int b2 = int.Parse(txtb2.Text);
int c1 = int.Parse(txtc1.Text);
int c2 = int.Parse(txtc2.Text);
if (a1 < 9)
{
txta1.Text = 0 + (a1 + 1).ToString();
}
else
{
if (m == 5)
{
if (a1 >= 14 && a1 <= a2 || a1 < 14)
{
txta1.Text = (a1 + 1).ToString();
}
else
{

txtb1.Text = (b1 + 1).ToString();
txtc1.Text = (c1 + 1).ToString();
txtjieju.Text += "第" + m + "局" + (a1 + 1).ToString() + ":" + txta2.Text + "\r" + "\n";
txtc2.Text = "0";
}
}
else
{
if (a1 >= 24 && a1 <= a2 || a1 < 24)
{
txta1.Text = (a1 + 1).ToString();
}
else
{
txtb1.Text = (b1 + 1).ToString();
txtc1.Text = (c1 + 1).ToString();
txtjieju.Text += "第" + m + "局" + (a1 + 1).ToString() + ":" + txta2.Text + "\r" + "\n";
txta1.Text = "00";
txta2.Text = "00";
txtc2.Text = "0";
txtm.Text = "第 " + (m + 1) + " 场";
m = m + 1;

}
}

}
if (txtb1.Text == "3")
{
txta1.Text = "00";
txta2.Text = "00";
txtb1.Text = "0";
txtb2.Text = "0";
txtc1.Text = "0";
txtc2.Text = "0";
m = 0;
txtm.Text = "第 " + (m + 1) + " 场";
txtjieju.Text += "第" + m + "局" + (a1 + 1).ToString() + ":" + txta2.Text + "\r" + "\n" + txtd1.Text + "胜";
}
}

private void txta1_TextChanged(object sender, EventArgs e)
{

}

private void button2_Click(object sender, EventArgs e)
{
int j1 = int.Parse(txta1.Text);
int j2 = int.Parse(txta2.Text);
int m1 = int.Parse(txtb1.Text);
int m2 = int.Parse(txtb2.Text);
int q1 = int.Parse(txtc1.Text);
int q2 = int.Parse(txtc2.Text);
if (j2 < 9)
{
txta2.Text = 0 + (j2 + 1).ToString();
}
else
{
if (m == 5)
{
if (j2 >= 14 && j2 <= j1 || j2 < 14)
{
txta2.Text = (j2 + 1).ToString();
}
else
{

txtb2.Text = (m2 + 1).ToString();
txtc2.Text = (q2 + 1).ToString();
txtjieju.Text += "第" + m + "局" + txta1.Text + ":" + (j2 + 1).ToString() + "\r" + "\n";
txta1.Text = "00";
txta2.Text = "00";
txtc1.Text = "0";
}
}
if (j2 >= 24 && j2 <= j1||j2<24)
{
txta2.Text = (j2 + 1).ToString();
}
else
{
txtb2.Text = (m2 + 1).ToString();
txtc2.Text = (q2 + 1).ToString();
txtjieju.Text += "第" + m + "局" + txta1.Text + ":" + (j2 + 1).ToString() + "\r" + "\n";
txta1.Text = "00";
txta2.Text = "00";
txtc1.Text = "0";
txtm.Text = "第 " + (m + 1) + " 场";
m = m + 1;
}

}
if (txtb2.Text == "3")
{
txta1.Text = "00";
txta2.Text = "00";
txtb1.Text = "0";
txtb2.Text = "0";
txtc1.Text = "0";
txtc2.Text = "0";
m = 0;
txtm.Text = "第 " + (m + 1) + " 场";
txtjieju.Text += "第" + m + "局" + txta1.Text + ":" + (j2 + 1).ToString() + "\r" + "\n" + txtd2.Text + "胜";
}
}

private void label1_Click(object sender, EventArgs e)
{

}

private void Form1_Load(object sender, EventArgs e)
{

}
}
}

 

转载于:https://www.cnblogs.com/lpq1/p/6188863.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值