Question

Consider the following procedure: procedure mystery (x, y, z); integer x, y, z;beginz =2; y = z + x;endand consider the following code fragment: A[1] := 2;A[2] := 1;n := 1;mystery (A[1],A[n],n);

What will be the final values of n, A[1] and A[2] if the parameters are passed by reference?

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times vary by subject and question complexity. Median response time is 34 minutes and may be longer for new subjects.

Related Computer Science Q&A

Find answers to questions asked by student like you

Q: Based on the code that I already have, please help me complete it. I am attempting to use 2 function...

A: Corrections in Program:Add a closing bracket after return statement of main.Remove the parameters fr...

Q: You need to use Eclipse to create this program.

A: Instructions for the first program:Create an array of size 5 and initialize a counter variable named...

Q: 2. Write a program called ListOddNumbers that prints the below (there is a single space between each...

A: Solution: 2. The below program is written in Java language to display the odd number between 1 and 5...

Q: do big data could replace the artistic vision of a creative director? and why?

A: Justification:“Yes”, big data replace the artistic vision of a creative director.

Q: Typically, a hospital patient receives medication that have been ordered by a particular doctor. Bec...

A: Lets write the business logic first. The business rules between PATIENT and ORDER will be.• A patien...

Q: Question: Write a program that prompts the user to enter the number of students and each student's s...

A: Solution:The python program has the following algorithm:Prompt and read the total number of students...

Q: Attached Files:  getRandomLib.h: // This library provides a few helpful functions to return rand...

A: Program Instructions:Include the necessary header files.Print hello message and as for a response.De...

Q: What is the best way to pass 2D arrays to a function? (C++) For my program, I have a 2D array (size:...

A: There are two ways to pass 2-D array to a function either by sending the array name in the function ...

Q: Write a program that coverts a zip code to a bar code. The bar codes use large and small bars. We wi...

A: Solution:#Define the functiondef checksum(zip):    #Declare the empty variable    sum = 0    #Loop e...