Computers and Technology

(a) if the following switch statement were implemented using a jump table, how many elements would the table contain?

would it make sense to use a jump table to implement this switch statement? why or why not? if not then what type of implementation will be more suitable?

why?

switch (i) {

case 40: j = a; break;

case 41: j = b; break;

case 42: j = c; break;

case 43: j = d; break;

case 44: j = e; break;

case 45: j = r; break;

case 46: j = g; break;

}

(b) answer the same questions as in part (a), using the following switch statement instead:

switch (i) {

case 20: j = a; break;

case 67: j = b; break;

case 97: j = c; break;

case 400: j = d; break;

case 310: j = e; break;

case 10: j = f; break;

}

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 06:20, kiarakagni
What is a point-in-time measurement of system performance?
Answers: 3
image
Computers and Technology, 24.06.2019 13:00, juuuuuu42
George heard about the benefits of a data warehouse. he wants to try implementing one for his organization. however, he is afraid that transferring data to the data warehouse will affect transaction time. which element ensures that transactions are not affected when moving data to a warehouse? when data is transferred to a data warehouse, the a area frees the source system to continue transaction processing.
Answers: 2
image
Computers and Technology, 24.06.2019 18:30, kristine2424
Is a type of bullying that takes place when a person intentionally posts negative information about another that is not true
Answers: 1
image
Computers and Technology, 24.06.2019 19:20, boyancecristina
Which command suppresses the visibility of a particular row or column in a worksheet?
Answers: 1
Do you know the correct answer?
(a) if the following switch statement were implemented using a jump table, how many elements would t...

Questions in other subjects: