Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using (.NET) Microsoft Visual Basics ONLY: Chapter 4- 6. Rewrite the following s

ID: 3784542 • Letter: U

Question

Using (.NET) Microsoft Visual Basics ONLY:

Chapter 4-

6. Rewrite the following statement so that it does not include a nested If-Then statement In other words, there should be only one If statement that performs the exact same logic. (2 points)

If Me.chkValuel.Checked Then

If Me.chkValue2.Checked Then

MessagBox.Show("Both checked")

End If

End If

7. Assume txtNuml and txtNum2 contain numeric values. Write an If...Then...Elself statement that displays a message box with one of the following messages as appropriate. (4 points)

Both numbers are positive

Only the first number is positive

Only the second number is positive

8. Determine if each of the following statements is true or false. (1 point each, 10 total)

Question

True or False

The condition within an If...Then statement is a Boolean expression

An If decision structure must have an Else clause.

The Select... Case statement can only be used if you have more than two cases.

The values of local variables are always retained in memory for the duration of a program or form execution.

In a logical Or expression, both operands must be true for the expression to evaluate to true.

Counter variables are useful for keeping track of the number of times a specific event occurs.

The variable sum is an example of a counter variable.

More than one check box can be selected at a time.

A Visual Basic statement must be typed in its entirety on a single line.

Algorithms are designed before the source code is typed.

Question

True or False

The condition within an If...Then statement is a Boolean expression

An If decision structure must have an Else clause.

The Select... Case statement can only be used if you have more than two cases.

The values of local variables are always retained in memory for the duration of a program or form execution.

In a logical Or expression, both operands must be true for the expression to evaluate to true.

Counter variables are useful for keeping track of the number of times a specific event occurs.

The variable sum is an example of a counter variable.

More than one check box can be selected at a time.

A Visual Basic statement must be typed in its entirety on a single line.

Algorithms are designed before the source code is typed.

Explanation / Answer

If Me.chkValue1.Checked And Me.chkValue2.Checked Then

MessageBox.show("Both Checked ")

Endif

2)if textnum1>= 0 And textnum2 >=0 Then

MessageBox. Show(" Both numbers are positive")

Elseif textnum1 > = 0 Then

MessageBox. Show('First number is positive")

Elseif textnum2 >= 0 Then

MessageBox. Show("Second number is positive")

3)

a)True

b) False

c)False (if there is two cases then it is far enough for the select statement)

d)false (the value of local variable remains there even after execution )

e)false (in logical if any one expression is true then the value is true)

f)true

g)true

h)false(only one check box can be selected)

I)true

J)true

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote