I have to create this bot where the workflow asks user for his name and two-digit lottery
number and displays if he is a winner.
These are the tasks:
• Ask name of the user and two-digit lottery number
• Give the user five chance to enter the correct lottery number
• If entry is below 54 and above 64, display “Enter your lottery number. X chance remaining.”
Here, X is the number of remaining chances for user.
• If entry is between 54 and 64, display, “Congratulations User! You won the lottery.” Replace
User with the name of the user.
• If chances end before correct entry, display “Sorry, you lost. No more chances remaining
Simplest, you can use Input Dialogue Box to display the messages and take input from the user.
You can have a do while loop, the end condition should be boolExit = true
First take the first Input from the user. store it in intEnteredValue
Create a counter, intCounter
Create a variable to store your number of chances, intThreshold
Then in the Do While, have an IF condition to check if that integer is between 54 and 64, If yes then display the Congrats message in Mesaage box and make intCounter = intCounter + intThreshold
If no, then increase the intCounter
at the last stage of Do Whilw, add an IF condition,
If intCounter > intThreshold
in Then block add, isplay message box, no more option left and make boolExit = True
1.ASSIGN count=5
Input Dialogue Box - str_UserInput
2.If cint(str_UserInput)>=54 and cint(str_UserInput)<=64
3. Then Message Box for “Congratulations User! You won the lottery.”
4. ELSE - Count=count-1
if count>0 then Message Box - You have count Chances left +( Input Dialogue Box ) connect to first Input Dialogue
else Message Box - Sorry, you lost. No more chances remaining
Sorry for being so annoying with this . but would you mind doing it on the actual studio and share with me to check what am I missing? Is giving me an error for some reason.