C#wpf多个文本框数值先乘以百分数然后相加输出另一个文本框
1个回答
展开全部
private void button1_Click(object sender,RouteEventArgs e)
{
double result=Convert.ToDouble(textBox1.Text)*0.15+Convert.ToDouble(textBox2.Text)*0.15+Convert.ToDouble(textBox3.Text)*0.1+Convert.ToDouble(textBox4.Text)*0.3+Convert.ToDouble(textBox5.Text)*0.3;
textBox6.Text=String.Format("综合成绩为:{0}",result);
}
{
double result=Convert.ToDouble(textBox1.Text)*0.15+Convert.ToDouble(textBox2.Text)*0.15+Convert.ToDouble(textBox3.Text)*0.1+Convert.ToDouble(textBox4.Text)*0.3+Convert.ToDouble(textBox5.Text)*0.3;
textBox6.Text=String.Format("综合成绩为:{0}",result);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询