问题描述
输入3个订单并单击显示统计按钮后,总消费,最低费用和最高费用(存储在totalArray中的总费用)的平均值将显示在消息框中。
i不知道怎么写这个代码,如果有人知道请帮忙。
谢谢。
我的尝试:
i没有尝试任何东西,因为我们的老师没有解释任何事情,并希望我们写下来。我已经在互联网上查看并没有帮助。
After entering 3 orders and when the show statistics button is clicked, the average of total charges, minimum charges and maximum charges ( of total charges stored in the totalArray) are displayed in a Messagebox.
i have no idea how to write the code for this, if someone knows please help.
Thank you.
What I have tried:
i haven't tried anything because our teacher hasn't explained anything and expect us to write it. i have looked in the internet and didn't help.
推荐答案
我没有尝试任何事情,因为我们的老师没有解释任何事情,并希望我们写下来。
i haven't tried anything because our teacher hasn't explained anything and expect us to write it.
告诉他,你因为他而失败了。事情的顺序是HomeWork的课程。
Tell him, that you failed because of him. The order of things is lessons then HomeWork.
我没有想法如何为此编写代码
i have no idea how to write the code for this
如果你不能编写代码,至少你可以做数学。
If you can't write code, at least you can do the maths.
decimal[] numbers = {2.1m, 2m, 3m, 5m, 3.2m, 1, 10};
decimal avg = numbers.Take(numbers.Count()).Average();
decimal min = numbers.Min();
decimal max = numbers.Max();
现在只显示平均值。文本框的最小值和最大值。注意:m用于使其成为小数。
Now just display the avg. min and max to textbox. Note: m used is to make it decimal.
这篇关于如何查找总费用,最低费用和最高费用的平均值,并在消息框中显示。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!