I was working on the task, while I am trying to use switch actvity I am unable to give condition to the switch expression.
Here are the grades of the “score” - variable
A: >90
B: 80-89
C: 70-79
D: 70-69
Please,help me on this
I was working on the task, while I am trying to use switch actvity I am unable to give condition to the switch expression.
Here are the grades of the “score” - variable
A: >90
B: 80-89
C: 70-79
D: 70-69
Please,help me on this
HI,
How about the following expression?
arrBorder = {90,80,70,60}
Then
Chr(65+arrBorder.Where(Function(i) i>score).Count)
Sample
Sample20231227-1.zip (2.9 KB)
Regards,
Switch doesn’t work like that. Switch takes a single value. For what you’re trying to do, you will want to use Else If.
Try this way. This should work for you.
score = The value you give from Input Dialog acitivty ' Assuming score is an integer variable
If score > 90 Then
' Code for grade A
ElseIf score >= 80 AndAlso score <= 89 Then
' Code for grade B
ElseIf score >= 70 AndAlso score <= 79 Then
' Code for grade C
ElseIf score >= 60 AndAlso score <= 69 Then
' Code for grade D
Else
' Code for other cases or default
End If
the below image will give you better understanding:
Regards