㈠、計劃html
①估計這個任務須要多少時間:9天數據庫
㈡、開發post
①需求分析:測試
拆成任務,編寫代碼this
此次做業是關於排球比賽計分程序,從排球比賽愛好着出發,但願每個排球觀衆都能更好的瞭解比賽得分。
做爲一個排球愛好者,我但願知道排球比賽的得分,以便更好的掌握比賽得分。編碼
任務:a,做爲排球愛好者須要知道每場A,B兩隊的得分;
b,須要知道兩個隊每局累加得分;
c,兩隊比分哪一隊勝出,怎麼表示出來;url
②生成設計文檔:設計
表現層:①觀衆3d
(代碼實現方式:winform窗體)代碼規範
業務層: 判斷
數據源:——→DB
③設計複審
3個小時
④代碼規範(爲目前的開發制定合適的規範)
⑤具體設計:
把每一場的比分存到數據庫中,在窗體控件中選擇某一場,顯示比分。
⑥具體編碼:
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();
}
}
}
如下省略部分
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 = "";
}
⑦代碼複審:4個小時
⑧測試(自測、修改代碼、提交代碼): 半小時
㈢、報告
①測試報告:
②計算工做量: