Prize calculator by

Integer number1= 1

Integer number2= 7

Do

number2 = number2 + 3

If number2 = 10

Display "You have won a prize"

number2=0

EndIf

number1=1-1

Loop Until number1 <> 0
in Statistics Answers by

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Answer

number1 number2 DISPLAY
1 7
1 10 You have won a prize
1 0
0 0
0 3
-1 3

Trace table as above. The table records any change to the integer variables and any display produced.

The algorithm goes through the loop statement twice. In that process number2 becomes 10 once, causing the display.

by Top Rated User (1.2m points)

Related questions

1 answer
asked Feb 26, 2016 in Geometry Answers by karan91 Level 2 User (1.3k points) | 1.5k views
1 answer
asked Feb 24, 2016 in Calculus Answers by karan91 Level 2 User (1.3k points) | 1.4k views
1 answer
1 answer
asked Oct 8, 2019 in Pre-Algebra Answers by anonymous | 2.1k views
1 answer
asked Apr 29, 2019 in Algebra 1 Answers by anonymous | 462 views
1 answer
Welcome to MathHomeworkAnswers.org, where students, teachers and math enthusiasts can ask and answer any math question. Get help and answers to any math problem including algebra, trigonometry, geometry, calculus, trigonometry, fractions, solving expression, simplifying expressions and more. Get answers to math questions. Help is always 100% free!
87,516 questions
100,279 answers
2,420 comments
733,233 users