Concept explainers
Explanation of Solution
The given code:
'checking intX is less than 10
If intX < 10 Then
'Set intY equal to 0
intY = 0
'checking intX is less than 20
Elseif intX < 20 Then
'set intY equal to 1
intY = 1
'checking intX is less than 30
Elseif intX < 30 Then
'set intY equal to 2
intY = 2
'checking intX is less than 40
Elseif intX < 40 Then
'set intY eual to 3
intY 3
'if the conditions are not true
Else
'set intY equal to -1
intY = -1
'end of if condition
End If
Assume “intX” is 5
If intX < 10 Then 'checks 5<10...
Explanation of Solution
The given code:
'checking intX is less than 10
If intX < 10 Then
'Set intY equal to 0
intY = 0
'end of if condition
End If
'checking intX is less than 20
If intX < 20 Then
'set intY equal to 1
intY = 1
'end of if condition
End If
'checking intX is less than 30
If intX < 30 Then
'set intY equal to 2
intY = 2
'end of if condition
End If
'checking intX is less than 40
If intX < 40 Then
'set intY eual to 3
intY 3
'end of if condition
End If
Assume “intX” is 5.
If intX < 10 Then 'checks 5<10...
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
Starting Out With Visual Basic, Student Value Edition (8th Edition)
- Write a Case clause that specifies all numbers less than 0.arrow_forwardWrite an if-else statement that works like this: If the sales variable is greater- than or equal-to 50,000, the commissionRate variable should be assigned the value 0.2. Otherwise, the commissionRate variable should be assigned the value 0.1.arrow_forwardWrite an if-else statement that works like this: If the sales variable is greaterthan or equal-to 50,000, the commissionRate variable should be assigned the value 0.2. Otherwise, the commissionRate variable should be assigned the value 0.1.arrow_forward
- 2. Write an if statement that assigns 1 to x if y is greater than 0.arrow_forwardWrite a series of if statements that will evaluate your grade contained within a variable called semesterGrade and displays your letter grade according to your course syllabus: 90-100 A 87-89 B+ 80-86 B 77-79 C+ 70-76 C below 70 Farrow_forwardin python pleasearrow_forward
- Write an if statement that assigns 10,000 to the variable bonus if the value of the variable goodsSold is greater than 500,000. Assume bonus and goodsSold have been declared and initialized.arrow_forwardValidy options is: Valid / Invalidarrow_forwardWrite an if/else statement that assigns variable good to 10 if variable value is equal to 55. Otherwise, it should assign 0 to variable good. TT T Arial 3 (12pt)arrow_forward
- The AND operator takes two Boolean expressions as operands and creates a compound Boolean expression that is true only when___. Question 11 options: O or 1 expressions are true the first expression is true the second expression is true both subexpressions are truearrow_forwardlanguage is java levelarrow_forwardA one-way if statement performs an action if the specified condition is true. If the condition is false, nothing is done. But what if you want to take alternative actions when the condition is false?arrow_forward
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT