vb.2010 PASS / FAIL按钮 [英] vb.2010 PASS/FAIL button

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

问题描述

伙计们,我遇到过这个问题,它让我感到非常难过。我是vb的新手并且已经学习了2个星期但是我无法通过这个问题获得任何好处





添加代码以便当用户单击通过/失败按钮时:

·如果任何文本框包含无效数据,请在状态框中显示来自

任务3的相应消息并停止该过程。



否则:

·如果两个或多个分数的值小于5则显示失败:2分少于
状态框中
超过5并停止该过程。



否则:

·使用所有分数的总和类别代码在状态框中显示通过字样

或失败。下表应该在您的计算中使用

类别代码通行证

A 15

B 25

C 30

·





示例:

o如果类别为A且总和是14然后结果是失败

o如果Category是A而Sum是15则结果是Pass

o如果Category是B并且Sum是24则结果是失败

o如果类别为B且总和为25则结果为通过

o如果类别为C且总和为29则结果为失败

o如果Category为C且Sum为30,则结果为Pass

hi guys I've come across this question and its got me absolutely stumped. i'm new to vb and have been learning it for 2 weeks but i cant get anywhere with this question


Add code so that when the user clicks the Pass / Fail button:
· If any text box contains invalid data, display the appropriate message from
Task 3 in the Status Box and stop the process.

Otherwise:
· If two or more scores have a value less than 5 display "Fail: 2 scores less
than 5" in the Status Box and stop the process.

Otherwise:
· Use the Sum of all Scores and the Category Code to display the word 'Pass'
or 'Fail' in the status box. The table below should be used in your calculation
Category Code Pass Mark
A 15
B 25
C 30
·


Examples:
o If Category is A and the Sum is 14 then the result is Fail
o If Category is A and the Sum is 15 then the result is Pass
o If Category is B and the Sum is 24 then the result is Fail
o If Category is B and the Sum is 25 then the result is Pass
o If Category is C and the Sum is 29 then the result is Fail
o If Category is C and the Sum is 30 then the result is Pass

推荐答案

好吧,我们不会做你的功课。

以下是它应该如何显示的骨架:

Well, we aren't going to do your homework.
Here's a skeleton of how it should look:
Private Sub btnPassFail_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnPassFail.Click
   If (AnyTextBoxContainsInvalidData())
      '' TODO
   Else If (TwoOrMoreScoresHaveValueLessThanFive())
      '' TODO
   Else
      '' TODO
   EndIf
End Sub

Private Function AnyTextBoxContainsInvalidData() As Boolean
  '' TODO
End Function

Private Function TwoOrMoreScoresHaveValueLessThanFive() As Boolean
  '' TODO
End Function





快乐编码。



Happy coding.


这篇关于vb.2010 PASS / FAIL按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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