Beruflich Dokumente
Kultur Dokumente
1
1. The following operations are used with a stack:
push x: add the value of x to the top of the stack; do not change x
pop x: put the top value of the stack into x, remove from the stack
After the following sequence of instructions, what are the values of a, b, c, d, and e?
integer a, b, c, d, e
a := 5; b := 10; c := 15; d := 20
push a
push b
push c
push d
pop e
pop e
pop e
pop a
#include <stdio.h>
#include <string.h>
struct name{
char lastname[20];
char firstname[20];
};
int main(void)
{
struct name *name_ptr;
__________________ ; -- Statement to be filled
........
}
In the above code, fill in the correct usage of the function pointer in the line ‘Statement to be
filled” from the list below.
a) name_ptr = &full_name
b) &name_ptr = full_name
c) name_ptr = &name
d) name_ptr = name
2
3. In the context of Access rights for Class inheritance, fill the numbers from 1 to 9 with values
‘yes’ or ‘no’
namespace Name
{
int age;
}
Which of the following is valid invocation of the variable 'age' when used from within a class
C?
a) Name:age
b) Name::age
c) namespace Name::age
d) C.Name::age
5. In an exception handling section, you have multiple handlers (i.e., catch expressions), each
one with a different parameter type. However, you do not have the corresponding 'throw'
statements. What would happen?
a) The code would fail at compile time indicating an error on “Not enough Throw statements”
b) The code would fail at run-time indicating an error on “No Matching exception handler”
c) The code would work fine
d) The code would work fine, provided the „catch‟ expressions are made to return a void
pointer
a) i, ii and iii
b) ii and iv
c) i and iv
d) ii and iii
3
7. Which of the following does a derived class not inherit from its base class?
a) i, ii and iv
b) i, ii and iii
c) iii and iv
d) ii, iii and iv
a) Virtual computer architecture that is able to distribute process execution across a parallel
infrastructure
b) Harnessing unused processing cycles of all computers in a network for solving problems too
intensive for any stand-alone machine
c) Applying the resources of many computers in a network to a single problem at the same time
d) All of the above