logo

Crowdly

Study the following code snippet and choose the correct value of iY that the Sho...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Study the following code snippet and choose the correct value of iY that the ShowMessage() function will output.

var

 iX, iY: integer; 

begin

 iX := (2 * 8 / 4) ; 

 case iX of

  1, 3, 7 : begin

               if (iX >= 3) and (iX <= 7) then

                iY := 1

               else if (iX > 1) and (iX < 3) then

                iY := 2

               else 

                iY := 3;

              end;

0, 2, 8 : begin

              if (iX >= 2) and (iX <= 8) then

                iY := 4

               else if (iX > 0) and (iX < 2) then

                iY := 5

               else 

                iY := 6;            

end;

4, 5, 6 : begin

              if (iX > 5) and (iX < 6) then

                iY := 7

               else if (iX >= 4) and (iX < 5) then

                iY := 8

               else 

                iY := 9;   

              end;

ShowMessage('The value of iY is ' + IntToStr(iY));

end;

More questions like this

Want instant access to all verified answers on campus.uctonlinehighschool.com?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome