1. What is the value of Z after this program is run?
2. Translate this pseudocode into real code:
Set z = 0 and n = 1000
While n is less than or equal to 2000 repeat this code:
a = n/1000 rounded down
b = (n- 1000*a)/100 rounded down
c = (n- 1000*a - 100*b)/10 rounded down
d = n - 1000*a - 100*b - 10*c
If a equals d and b equals c and a does not equal b then add 1 to z
Add 1 to n
Paste the entire program as your response along with what it outputs. As a bonus, you can describe the purpose of the program.
If you have forgotten some of the syntax, explanations and examples can be found here: http://www.categories.acsl.org/wiki/index.php?title=What_Does_This_Program_Do%3F