MOD问题 [英] MOD question

查看:78
本文介绍了MOD问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

输入介于102和676之间的数字并使用循环结构找到介于1和所提供数字之间的所有偶数的平均值时,正确的代码是什么。


另外,我如何编写程序以使用退出键退出和输入键来执行计算?


谢谢

What would be the correct code when entering a number between 102 and 676 and having it find the average of all the even numbers between 1 and the supplied number using the looping construct.

Also how do I code the program to use the Escape Key to exit and the Enter Key to perform a computation?

Thanks

推荐答案

试试这个:


如果数字MOD 2 = 0那么

结果=(数字+ 2)/ 2
Else

结果=(数字+ 1)/ 2

结束如果



" ; Edward Mogel < ED ********* @ yahoo.com>在消息中写道

新闻:0E ********************************** @ microsof t.com ...
Try this:

If number MOD 2 = 0 then
result = (number + 2 ) / 2
Else
result = ( number + 1 ) / 2
End If


"Edward Mogel" <ed*********@yahoo.com> wrote in message
news:0E**********************************@microsof t.com...
在输入介于102和676
之间的数字并找到介于1和

使用循环结构提供的数字。
另外,我如何编写程序以使用Escape键退出并输入
键来执行计算?
谢谢
What would be the correct code when entering a number between 102 and 676 and having it find the average of all the even numbers between 1 and the
supplied number using the looping construct.
Also how do I code the program to use the Escape Key to exit and the Enter Key to perform a computation?
Thanks



Brian ...我没有看到循环结构 ...再次阅读作业问题

:-)


" Brian" <无**** @ prairie.lakes.com>在消息中写道

新闻:10 ************* @ corp.supernews.com ...
Brian... I don''t see the "looping construct" ... read the homework question
again :-)

"Brian" <no****@prairie.lakes.com> wrote in message
news:10*************@corp.supernews.com...
试试这个:

如果编号MOD 2 = 0则
结果=(编号+ 2)/ 2
否则
结果=(编号+ 1)/ 2
结束如果

" Edward Mogel" < ED ********* @ yahoo.com>在消息中写道
新闻:0E ********************************** @ microsof t.com。 ..
Try this:

If number MOD 2 = 0 then
result = (number + 2 ) / 2
Else
result = ( number + 1 ) / 2
End If
"Edward Mogel" <ed*********@yahoo.com> wrote in message
news:0E**********************************@microsof t.com...
输入介于102和


676之间的数字并找到介于1和
使用循环结构提供的数字。

676 and having it find the average of all the even numbers between 1 and the
supplied number using the looping construct.


另外,我如何编写程序以使用Escape键退出和

Also how do I code the program to use the Escape Key to exit and the


输入密钥来执行计算?

Enter Key to perform a computation?


谢谢







谢谢。我输入了我的点击程序,但是当我点击计算按钮时,它仍然没有
执行计算。我真的没有

确定有什么问题。


你有关于逃生的任何建议并输入我询问的钥匙

约在我的上一篇文章中。


非常感谢任何帮助。这是我第一次使用VB.NET和

我正在努力学习它是如何工作的。您的时间和帮助非常感谢

.


Edward Mogel

***通过Developersdex发送 http://www.developersdex.com ***

不要只是参与在USENET ......获得奖励!


Thanks. I entered that into my click procedure and it still does not
perform a calculation when I click the compute button. I''m really not
sure what is wrong.

Do you have any suggestions about the escape and enter key I inquired
about in my last post.

Any help is greatly appreciated. This is my first time using VB.NET and
I''m struggling to learn how it works. Your time and assistance is
greatly appreciated.

Edward Mogel
*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!


这篇关于MOD问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆