A programming language permits indexing of arrays with character subscripts; for example, CHR_ARRAY[‘A’:’D’]. In such a case, the elements of the array are CHR_ARRAY[‘A’], CHR_ARRAY[‘B’], and so on, and the ordinal number (ORD) of the characters, namely, ORD(‘A’) = 1, ORD(‘B’) = 2, ORD(‘Z’) = 26 and so on, is used to denote the index. Now, two arrays TEMP[1:5, -1:2] and CODE[‘A’:’Z’, 1:2] are stored in memory beginning from address 500. Additionally, CODE succeeds TEMP in storage. Calculate the addresses of (i) TEMP[5, -1], (ii) CODE[‘N’,2] and (iii) CODE[‘Z’,1].

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter12: Points, Classes, Virtual Functions And Abstract Classes
Section: Chapter Questions
Problem 3PE
icon
Related questions
Question

A programming language permits indexing of arrays with character subscripts;
for example, CHR_ARRAY[‘A’:’D’]. In such a case, the elements of the array are
CHR_ARRAY[‘A’], CHR_ARRAY[‘B’], and so on, and the ordinal number (ORD)
of the characters, namely, ORD(‘A’) = 1, ORD(‘B’) = 2, ORD(‘Z’) = 26 and so on,
is used to denote the index.
Now, two arrays TEMP[1:5, -1:2] and CODE[‘A’:’Z’, 1:2] are stored in
memory beginning from address 500. Additionally, CODE succeeds TEMP
in storage. Calculate the addresses of (i) TEMP[5, -1], (ii) CODE[‘N’,2] and
(iii) CODE[‘Z’,1].

Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Randomized Select Algorithm
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning