Asked by ami
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
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!!!"
ELSE
PRINT "Better luck next time"
PRINT "I picked "; CompNum
END IF
INPUT "Would you like to play again "; Answer$
Answer$ = Upper$(Answer$)
LOOP
END
Answers
Answered by
Ayush Maddhesiya
Question - write an algorithm to print the table of any number and also draw a flow chart .
Which answer this..........
Which answer this..........
Answered by
Ayush Maddhesiya
Question - write an algorithm to print the table of any number and also draw a flow chart .
Which answer this..........
Answered reply ...........
Which answer this..........
Answered reply ...........
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.