A-Asking the user to pick a number between 1 and 20 and having the computer pick a number between 1 and 20 and telling the user if they won or lost

B- For finding the logic error in the program
C- For finding and fixing the logic error in the program
D- For finding and fixing the logic error in the program and including one full paragraph in your *.rtf file explaining the fix.

Below is the code

REM Guess a number between 1 and 5

[Start]
Answer$ = "Y"
DO WHILE Answer$ = "Y"

REM the statement below is the way the computer guesses a number
CompNum = INT(5 * RND(1))
CLS
INPUT "Guess a number between 1 and 5 "; NUM
IF (NUM < 1 OR NUM > 5) THEN
PRINT "That number is not between 1 and 5 "
GOTO [Start]
END IF

IF NUM = CompNum THEN
PRINT "Correct!!!"
PRINT
PRINT

ELSE
PRINT "Better luck next time"
PRINT
PRINT "I picked "; CompNum
PRINT
PRINT

END IF

INPUT "Would you like to play again "; Answer$
Answer$ = Upper$(Answer$)
LOOP
END

Question - write an algorithm to print the table of any number and also draw a flow chart .

Which answer this..........

Question - write an algorithm to print the table of any number and also draw a flow chart .

Which answer this..........

Answered reply ...........

To find the logic error in the program, we need to analyze the code and understand its purpose.

Upon analyzing the code, we can identify the following logic errors:

1. The range for the computer's random number generator is incorrect. The code uses `CompNum = INT(5 * RND(1))` to generate a random number between 1 and 5, but the task requires generating a number between 1 and 20.

To fix this logic error, we need to modify the line of code to generate a random number between 1 and 20. We can use `CompNum = INT(20 * RND(1)) + 1` instead.

2. The program does not check if the user's input is a number. If the user enters a non-numeric value, it will cause an error.

To fix this logic error, we need to add error handling to ensure that the user's input is a valid number. We can use the `VAL` function to convert the input to a numeric value and check if it returns 0 (indicating a non-numeric input). If it does, we can display an error message and prompt the user to enter a valid number.

The updated code, fixing the logic errors, would be as follows:

```vb
REM Guess a number between 1 and 20

[Start]
Answer$ = "Y"
DO WHILE Answer$ = "Y"

REM the statement below is the way the computer guesses a number
CompNum = INT(20 * RND(1)) + 1
CLS
INPUT "Guess a number between 1 and 20 "; NUM

IF VAL(NUM) = 0 THEN
PRINT "Invalid input. Please enter a valid number."
GOTO [Start]
END IF

IF (NUM < 1 OR NUM > 20) THEN
PRINT "That number is not between 1 and 20 "
GOTO [Start]
END IF

IF NUM = CompNum THEN
PRINT "Correct!!!"
PRINT
PRINT

ELSE
PRINT "Better luck next time"
PRINT
PRINT "I picked "; CompNum
PRINT
PRINT

END IF

INPUT "Would you like to play again "; Answer$
Answer$ = Upper$(Answer$)
LOOP
END
```

I have also included one full paragraph explaining the fix in this response.