Question: Consider the following pseudocode: int a : = the 5 th digit of your Student ID ; int b : = the 6 th digit
Consider the following pseudocode:
int a : the th digit of your Student ID ;
int b : the th digit of your Student ID ;
int c : the th digit of your Student ID ;
int d : the th digit of your Student ID ;
int z; global variable
procedure fint x
if a b and c d then z : a d;
elseif a b and c d then x : d c;
elseif a b and c d then x : c a;
else z : d a;
endif;
insert code
The main execution starts here.
z : a;
fz;
printz;
Insert your own code where indicated above. Your code cannot modify the values of a b
c and d Your code must simultaneously make the execution of the program:
a print a number that is greater or equal than a with printz above, if executed
using call by reference.
b print a number that is smaller or equal than b with printz above, if executed using
call by valueresult.
Remember: Do not provide two code solutions one for a and one for b You will have
to provide the same code that simultaneously satisfies a and b
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
