Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please show all work QUESTION 9: Below is a tiny computer program written in a made up language. Line numbers are added for easy identification;
Please show all work
QUESTION 9: Below is a tiny computer program written in a "made up" language. Line numbers are added for easy identification; they are not really a part of the program. O BEGIN PROGRAM 1DECLARE VARIABLE x AS INTEGER; 2 3 LET x = 1; 4 5 BEGIN LOOP 6 DISPLAY "Hi there!" ON SCREEN; 7 LET x = x + 3; 8 IF (x IS GREATER THAN OR EQUAL TO y) THEN EXIT LOOP; 9 CONTINUE LOOP 10 PRINT "We are done printing." TO SCREEN; 11 END PROGRAM DECLARE VARIABLE y AS INTEGER; 4 LET y 15; a) What control structure is illustrated by lines 5 through 9? b) What control structure is illustrated by line 8? c) When x is equal to 4, and we are at line 8, what happens next? Explain in detail d) When will the loop end? Explain in detail. e) How many times will "Hi there!" be displayed on the screen? (HINT: It will help to walk through the program - write down the current value of x and whether the message will be printed to the screen. Remember Line 3 sets the initial value of x, then at line 6 we display the message, then at line 7 we change the value of x)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started