二阶段12.16

Posted on 2018-12-20 10:02  WTC*  阅读(98)  评论(0编辑  收藏  举报

由于12.15日是四六级考试,我们没有时间来写,所以隔了一天更新。

  今天我编写了等级判断程序,可以自动判断输入的等级进行计算与

检校。

其中部分判断代码:

string str1 = comboBox1.Text;
string str2 = "图根导线";
string str3 = "一级导线";
string str4 = "二级导线";
string str5 = "三级导线";
string str6 = "四等导线";

if (str1.Equals(str2, StringComparison.OrdinalIgnoreCase) == true)
{ string a = "60*√n";
textBox2.Text = a;
textBox4.Text = "1/2000";
}
else if (str1.Equals(str3, StringComparison.OrdinalIgnoreCase) == true)
{string a = "10*√n";
textBox2.Text = a;
textBox4.Text = "1/15000";
}
else if (str1.Equals(str4, StringComparison.OrdinalIgnoreCase) == true)
{string a = "16*√n";
textBox2.Text = a;
textBox4.Text = "1/10000";
}
else if (str1.Equals(str5, StringComparison.OrdinalIgnoreCase) == true)
{
string a = "24*√n";
textBox2.Text = a;
textBox4.Text = "1/5000";
}
else if (str1.Equals(str6, StringComparison.OrdinalIgnoreCase) == true)
{
string a = "5*√n";
textBox2.Text = a;
textBox4.Text = "1/35000";
}
else 
{
string a = "3.6*√n";
textBox2.Text = a;
textBox4.Text = "1/55000";
}

}