Showing posts with label Multiple Choice. Show all posts
Showing posts with label Multiple Choice. Show all posts

Wednesday, August 05, 2009

Software Engineering

1. Software Engineering primarily aims on
a. Reliable software
b. Cost effective software
c. Reliable and cost effective software
d. Non of the above

2. A good specification should be
a. Unambiguous
b. Distinctly specific
c. Functional
d. None of the above

3. Which of the following is a tool in design phase?
a. Abstraction
b. Refinement
c. Information hiding
d. None of the above

4. In object oriented design of software, which of the following is not true?
a. Objects inherit the properties of the class
b. Classes are defined based on the attributes of objects
c. An object can belong to two classes
d. Classes are always different

5. Information hiding is to hide from user, details
a. That are relevant to him
b. That are irrelevant to him
c. That may be maliciously handled by him
d. That are confidential

6. Design phase includes
a. Data, architectural and procedural designs only
b. Architectural, procedural and interface designs only
c. Data, architectural and interface designs only
d. Data, architectural, interface and procedural designs

7. Data structure suitable for the application is discussed in
a. Data design
b. Architectural design
c. Procedural design
d. Interface design

8. Design phase will usually be
a. Top-down
b. Bottom-up
c. Random
d. Centre fringing

9. Assertions are conditions which are true at the point of execution
a. Always
b. Sometimes
c. Many times
d. No time

10. Assuming the existence of a start and end nodes for a program graph (PG), the total number of paths is equivalent to ________________ set of test data required to test software.
a. Minimum
b. Maximum
c. Optimum
d. Supremum

11. In a program graph (PG), if X is a if-then-else node and the number of paths from if part to end node is y and for else part is Z with the number of paths from strat node to end node is x, the total number of paths through X is
a. xy+z
b. xz+y
c. x+y+z
d. x(y+z)

12. If X is a case statement in a program graph (PG) with n cases instead of an if-then-else statement in the previous question with each case leading to only one path to end node, total number of paths through X is
a. x+n
b. x**n
c. x*log(n)
d. x*n

13. Structured programming codes include
a. Sequencing
b. Alteration
d. Multiple exit from loops

14. Which of the following is a desirable property of module?
a. Independency
b. Low cohesiveness
c. High coupling
d. Multifunctional

15. Which of the following types of maintenance takes the maximum chunk of the total maintenance effort in a typical commercial application environment?
a. Adaptive maintenance
b. Corrective maintenance
c. Preventive maintenance
d. Perfective maintenance

16. An important aspect in coding is
a. Readability
b. Productivity
c. To use as small memory space as possible
d. Brevity

17. One way to improve readability in coding is to
a. Avoid goto statement
b. Name variables and functions according to their use
c. Modularize the program
d. None of the above

18. The data flow model of an application mainly shows
a. The underlying data and the relationship among them
b. Processing requirements and he flow of the data
c. Decision and control information
d. Communication network structure

19. According to Brooks, if n is the number of programmers in a project team then the number of communication path is
a. n*(n-1)/2
b. n*log(n)
c. n
d. n*(n+1)/2

20. The extent to which the software can continue to operate correctly despite the introduction of invalid input is called as
a. Reliability
b. Robustness
c. Fault-tolerance
d. Portability

21. Which of the following statements is not true?
a. Content coupling in a module is desirable
b. Logical cohesion in a module is desirable
c. Stamp coupling is preferred over functional coupling
d. None of the above

22. Configuration management is not concerned with
a. Controlling changes to the source code
b. Choice of hardware configuration for an application
c. Controlling documentation changes
d. Maintaining versions of software

23. The railway reservation system currently operational in India can be classified as a
a. Batch processing system
b. Real-time system
c. Online system
d. Expert system

24. Data flow diagram, regular expression and transition table can be combined to provide __________________ for functional specification OS system software
a. Decision table
b. Finite state automata
c. Event table
d. None of the above

25. A program P calls two subprograms P1 and P2. P1 can fail 50% times and P2 40% times P can fail
a. 50%
b. 60%
c. 10%
d. 70%

26. Which of the following graph theoretic concept will be useful in software testing?
a. Cyclomatic number
b. Hamiltonian circuit
c. Eularian cycle
d. None of the above

27. In a decision table if there are 3 variables and 3 rules, implies
a. Specification may not be complete
b. Design could be faulty
c. Coding will be incorrect
d. All of the above

28. In unit testing of a module, it is found for a set of test data, at the maximum 90% of the code alone were tested with the probability of success 0.9. the reliability of the module is
a. Atleast greater than 0.9
b. Equal to 0.9
c. Atmost 0.81
d. Atleast 1/0.81

29. Which of the following testing methods is normally used as the acceptance test for a software system?
a. Regression testing
b. Integration testing
c. Unit testing
d. Functional testing

30. A computer program can often be a very satisfactory __________________ of a physical system such as road traffic conditions
a. Solution
b. Replacement
c. Stimulation
d. Model

31. On an average, the programmer months is given by 3.6*(KDSI)**1.2. If so, a project requiring one thousand source instruction will require
a. 3.6 PM
b. 0.36PM
c. 0.0036PM
d. 7.23PM

32. Considering a program graph(PG) with statement as vertices and control as edges, which of the following is not true for any program graph
a. PG is always acyclic
b. PG is always a directed graph
c. There won’t be any self loops
d. PG is always a connected graph

33. In object-oriented design of software, objects have
a. Attributes and name only
b. Operations and name only
c. Attributes, name and operations
d. None of the above
___________________________________________________________________________________________________

Sunday, July 19, 2009

Overview of Data Communication

1. The ____________ is the physical path over which a message travels.
a. Protocol
b. Medium
c. Signal
d. All the above

2. The information to be communicated in a data communications system is the _________________
a. Medium
b. Protocol
c. Message
d. Transmission

3. Frequency of failure and network recovery time after a failure is measures of the _______________ of a network.
a. Performance
b. Reliability
c. Security
d. Feasibility

4. An unauthorized user is a network ____________ issue.
a. Performance
b. Reliability
c. Security
d. All the above

5. Which topology requires a central controller or hub?
a. Mesh
b. Star
c. Bus
d. Ring

6. Which topology requires a multipoint connection?
a. Mesh
b. Star
c. Bus
d. Ring

7. Communication between a computer and a keyboard involves _______ transmission.
a. Simplex
b. Half-duplex
c. Full-duplex
d. Automatic

8. In a network with 25 computers, which topology would require the most extensive cabling?
a. Mesh
b. Star
c. Bus
d. Ring

9. A television broadcast is an example of ____________ transmission.
a. Simplex
b. Half-duplex
c. Full-duplex
d. Automatic

10. A _____________connection provides a dedicated link between two devices.
a. Point-to-point
b. Multipoint
c. Primary
d. Secondary

11. In a ____________ connection, more than two devices can share a single link.
a. Point-to-point
b. Multipoint
c. Primary
d. Secondary

12. In a transmission, the channel capacity is shared by both communicating devices at all times.
a. Simplex
b. Half-duplex
c. Full-duplex
d. Half-simplex

13. A cable break in a ___________ topology stops all transmission.
a. Mesh
b. Bus
c. Star
d. Primary

14. Which organisation has authority over interstate and international commerce in the communications filed?
a. ITU-T
b. IEEE
c. FCC
d. ISO

15. The Internet model consists of ____________ layers.
a. Three
b. Five
c. Seven
d. Eight

16. The process-to-process delivery of the entire message is the responsibility of the ___________ layer.
a. Network
b. Transport
c. Application
d. Physical

17. The _____________ layer is the layer closest to the transmission medium.
a. Physical
b. Data link
c. Network
d. Transport

18. Mail services are available to network users through the ___________ layer.
a. Data link
b. Physical
c. Transport
d. Application

19. As the data packet moves from the lower to the upper layers, headers are_________
a. Added
b. Subtracted
c. Rearranged
d. Modified

20. As the data packet moves from upper to lower layers, headers are____________
a. Added
b. Removed
c. Rearranged
d. Modified

21. The __________ layer lies between the network layer and the application layer.
a. Physical
b. Data link
c. Transport
d. None of the above

22. Layer 2 lies between the physical and the _______________ layer.
a. Network
b. Data link
c. Transport
d. None of the above

23. When data are transmitted from device A to device B, the header from A’s layer 4 is read by B’s _____________ layer.
a. Physical
b. Transport
c. Application
d. None of the above

24. The _________________ layer changes bits into electromagnetic signals.
a. Physical
b. Data link
c. Transport
d. None of the above

25. The physical layer is concerned with the transmission of ___________ over the physical medium.
a. Programs
b. Dialogs
c. Protocols
d. Bits

26. Which layer functions as a liaison between user support layers and network support layers?
a. Network
b. Physical
c. Transport
d. Application

27. What is the main function of the transport layer?
a. Node-to-node delivery
b. Process-to-process delivery
c. Synchronization
d. Updating and maintenance of routing tables

28. Which of the following is an application layer service?
a. Remote log-in
b. File transfer and access
c. Mail service
d. All the above
_________________________________________________________________________________________________

Thursday, June 04, 2009

Java Fundamental-I

Q1 Given the following class, which statements can be inserted at position 1 without causing a compilation error?

public class Q6db8 {

int a;

int b = 0;

static int c;


public void m() {

int d;

int e = 0;

// Position 1

}

}

Select the four correct answers.

a. a++;

b. b++;

c. c++;

d. d++;

e. e++;


Q2 Which statements are true about the effect of the >> and >>> operators? Select the three correct answers.

a. For non-negative values of the left operand, the >> and >>> operators will have the same effect.

b. The result of (-1 >> 1) is 0.

c. The result of (-1 >>> 1) is –1.

d. The value returned by >>> will never be negative if the left operand is non-negative.

e. When using the >> operator, the left-most bit of the resulting value will always have the same bit value as the left-most bit of the left operand.

Q3 What is wrong with the following code?

class MyException extends Exception {}

public class Qb4ab {

public void foo() {

try {

bar();

} finally {

baz();

} catch (MyException e) {}

}

public void bar() throws MyException {

throw new MyException();

}

public void baz() throws RuntimeException {

throw new RuntimeException();

}

}

Select the one correct answer.

a. Since the method foo() does not catch the exception generated by the method baz(), it must declare the RuntimeException in a throws clause.

b. A try block cannot be followed by both a catch and a finally block.

c. An empty catch block is not allowed.

d. A catch block cannot follow a finally block.

e. A finally block must always follow one or more catch blocks.


Q4 What will be written to the standard output when the following program is run?

public class Qd803 {

public static void main(String[] args) {

String word = "restructure";

System.out.println(word.substring(2, 3));

}

}

Select the one correct answer.

a. est

b. es

c. str

d. st

e. s


Q5 Given that a static method doIt() in the class Work represents work to be done, which block of code will succeed in starting a new thread that will do the work?

Select the one correct answer.

a. Runnable r = new Runnable() {

public void run() {

Work.doIt();

}

};


b. Thread t = new Thread(r);

t.start();


c. Thread t = new Thread() {

public void start() {

Work.doIt();

}

};

t.start();


d. Runnable r = new Runnable() {

public void run() {

Work.doIt();

}

};

r.start();


e. Thread t = new Thread(new Work());

t.start();


f. Runnable t = new Runnable() {

public void run() {

Work.doIt();

}

};

t.run();


Q6 What will be printed when the following program is run?

public class Q8929 {

public static void main(String[] args) {

for (int i=12; i>0; i-=3)

System.out.print(i);

System.out.println("");

}

}

Select the one correct answer.

a. 12

b. 129630

c. 12963

d. 36912

e. None of the above.


Q7 What will be the result of attempting to compile and run the following code?

public class Q275d {

static int a;

int b;

public Q275d() {

int c;

c = a;

a++;

b += c;

}

public static void main(String[] args) {

new Q275d();

}

}

Select the one correct answer.

a. The code will fail to compile since the constructor is trying to access static members.

b. The code will fail to compile since the constructor is trying to use static field a before it has been initialized.

c. The code will fail to compile since the constructor is trying to use field b before it has been initialized.

d. The code will fail to compile since the constructor is trying to use local variable c before it has been initialized.

e. The code will compile and run without any problems.


Q8 What will be written to the standard output when the following program is run?

public class Q63e3 {

public static void main(String[] args) {

System.out.println(9 ^ 2);

}

}

Select the one correct answer.

a. 81

b. 7

c. 11

d. 0

e. false


Q9 Which statements is true about the compilation and execution of the following program with assertions enabled?

public class Qf1e3 {

String s1;

String s2 = "hello";

String s3;

Qf1e3() {

s1 = "hello";

}

public static void main(String[] args) {

(new Qf1e3()).f();

}

{

s3 = "hello";

}

void f() {

String s4 = "hello";

String s5 = new String("hello");

assert(s1.equals(s2)); // (1)

assert(s2.equals(s3)); // (2)

assert(s3 == s4); // (3)

assert(s4 == s5); // (4)

}

}

Select the one correct answer.

a. The compilation will fail.

b. The assertion on the line marked (1) will fail.

c. The assertion on the line marked (2) will fail.

d. The assertion on the line marked (3) will fail.

e. The assertion on the line marked (4) will fail.

f. The program will run without any errors.


Q10 Which declarations of the main() method are valid in order to start the execution of an application?

Select the two correct answers.

a. public void main(String args[])

b. public void static main(String args[])

c. public static main(String[] argv)

d. final public static void main(String [] array)

e. public static void main(String args[])


Q11 Under which circumstance will a thread stop?

Select the one correct answer.

a. The run() method that the thread is executing ends.

b. The call to the start() method of the Thread object returns.

c. The suspend() method is called on the Thread object.

d. The wait() method is called on the Thread object.


Q12 When creating a class that associates a set of keys with a set of values, which of these interfaces is most applicable?

Select the one correct answer.

a. Collection

b. Set

c. SortedSet

d. Map


Q13 What is the result of running the following code with assertions enabled?

public class Q1eec {

static void test(int i) {

int j = i/2;

int k = i >>> 1;

assert j == k : i;

}

public static void main(String[] args) {

test(0);

test(2);

test(-2);

test(1001);

test(-1001);

}

}

Select the one correct answer.

a. The program executes normally and produces no output.

b. An AssertionError with 0 as message is thrown.

c. An AssertionError with 2 as message is thrown.

d. An AssertionError with -2 as message is thrown.

e. An AssertionError with 1001 as message is thrown.

f. An AssertionError with -1001 as message is thrown.


Q14 What will be written to the standard output when the following program is run?

class Base {

int i;

Base() { add(1); }

void add(int v) { i += v; }

void print() { System.out.println(i); }

}

class Extension extends Base {

Extension() { add(2); }

void add(int v) { i += v*2; }

}

public class Qd073 {

public static void main(String[] args) {

bogo(new Extension());

}

static void bogo(Base b) {

b.add(8);

b.print();

}

}

Select the one correct answer.

a. 9

b. 18

c. 20

d. 21

e. 22


Q15 Which declarations of a native method are valid in the declaration of the following class?

public class Qf575 {

// Insert declaration of a native method here

}

Select the two correct answers.

a. native public void setTemperature(int kelvin);

b. private native void setTemperature(int kelvin);

c. protected int native getTemperature();

d. public abstract native void setTemperature(int kelvin);

e. native int setTemperature(int kelvin) {}


Q16 Which collection implementation is suitable for maintaining an ordered sequence of objects, when objects are frequently inserted and removed from the middle of the sequence?

Select the one correct answer.

a. TreeMap

b. HashSet

c. Vector

d. LinkedList

e. ArrayList


Q17 Which statements can be inserted at the indicated position in the following code to make the program print 1 on the standard output when executed?

public class Q4a39 {

int a = 1;

int b = 1;

int c = 1;

class Inner {

int a = 2;

int get() {

int c = 3;

// Insert statement here.

return c;

}

}

Q4a39() {

Inner i = new Inner();

System.out.println(i.get());

}

public static void main(String[] args) {

new Q4a39();

}

}

Select the two correct answers.

a. c = b;

b. c = this.a;

c. c = this.b;

d. c = Q4a39.this.a;

e. c = c;


Q18 Which is the earliest line in the following code after which the object created in the line marked (0) will be a candidate for garbage collection, assuming no compiler optimizations are done?

public class Q76a9 {

static String f() {

String a = "hello";

String b = "bye"; // (0)

String c = b + "!"; // (1)

String d = b; // (2)

b = a; // (3)

d = a; // (4)

return c; // (5)

}

public static void main(String[] args) {

String msg = f();

System.out.println(msg); // (6)

}

}

Select the one correct answer.

a. The line marked (1).

b. The line marked (2).

c. The line marked (3).

d. The line marked (4).

e. The line marked (5).

f. The line marked (6).


Q19 Which method from the String and StringBuffer classes modifies the object on which it is invoked?

Select the one correct answer.

a. The charAt() method of the String class.

b. The toUpperCase() method of the String class.

c. The replace() method of the String class.

d. The reverse() method of the StringBuffer class.

e. The length() method of the StringBuffer class.


Q20 Which statement, when inserted at the indicated position in the following code, will cause a runtime exception?

class A {}

class B extends A {}

class C extends A {}

public class Q3ae4 {

public static void main(String[] args) {

A x = new A();

B y = new B();

C z = new C();

// Insert statement here

}

}

Select the one correct answer.

a. x = y;

b. z = x;

c. y = (B) x;

d. z = (C) y;

e. y = (A) y;


Q21 Which of these are keywords in Java?

Select three correct answers.

a. default

b. NULL

c. String

d. throws

e. long


Q22 A method within a class is only accessible by classes that are defined within the same package as the class of the method. How can such a restriction be enforced?

Select the one correct answer.

a. Declare the method with the keyword public.

b. Declare the method with the keyword protected.

c. Declare the method with the keyword private.

d. Declare the method with the keyword package.

e. Do not declare the method with any accessibility modifiers.


Q23 Which code initializes the two-dimensional array tab so that tab[3][2] is a valid element?

Select the two correct answers.

a. int[][] tab = {

{ 0, 0, 0 },

{ 0, 0, 0 }

};


b. int tab[][] = new int[4][];

for (int i=0; i 0) System.out.println(args[ix]);
}

e. public static void main(String[] args) {
try { System.out.println(args[args.length-1]); }
catch (NullPointerException e) {}
}

Q32 Which statements are true about the collection interfaces?
Select the three correct answers.
a. Set extends Collection.
b. All methods defined in Set are also defined in Collection.
c. List extends Collection.
d. All methods defined in List are also defined in Collection.
e. Map extends Collection.

Q33 Which is the legal range of values for a short?
Select the one correct answer.
a. –27 to 27–1
b. –28 to 28
c. –215 to 215–1
d. –216 to 216–1
e. 0 to 216–1

Q34 What is the name of the method that threads can use to pause their execution until signalled to continue by another thread?
Fill in the name of the method (do not include a parameter list).

Q35 Given the following class definitions, which expression identifies whether the object referred to by obj was created by instantiating class B rather than classes A, C, and D?
class A {}
class B extends A {}
class C extends B {}
class D extends A {}
Select the one correct answer.
a. obj instanceof B
b. obj instanceof A && !(obj instanceof C)
c. obj instanceof B && !(obj instanceof C)
d. !(obj instanceof C || obj instanceof D)
e. !(obj instanceof A) && !(obj instanceof C) && !(obj instanceof D)

Q36 What will be written to the standard output when the following program is executed?
public class Q8499 {
public static void main(String[] args) {
double d = -2.9;
int i = (int) d;
i *= (int) Math.ceil(d);
i *= (int) Math.abs(d);
System.out.println(i);
}
}
Select the one correct answer.
a. -12
b. 18
c. 8
d. 12
e. 27

Q37 What will be written to the standard output when the following program is executed?
public class Qcb90 {
int a;
int b;
public void f() {
a = 0;
b = 0;
int[] c = { 0 };
g(b, c);
System.out.println(a + " " + b + " " + c[0] + " ");
}
public void g(int b, int[] c) {
a = 1;
b = 1;
c[0] = 1;
}
public static void main(String[] args) {
Qcb90 obj = new Qcb90();
obj.f();
}
}
Select the one correct answer.
a. 0 0 0
b. 0 0 1
c. 0 1 0
d. 1 0 0
e. 1 0 1

Q38 Given the following class, which are correct implementations of the hashCode() method?
class ValuePair {
public int a, b;
public boolean equals(Object other) {
try {
ValuePair o = (ValuePair) other;
return (a == o.a && b == o.b)
|| (a == o.b && b == o.a);
} catch (ClassCastException cce) {
return false;
}
}
public int hashCode() {
// Provide implementation here.
}
}
Select the three correct answers.
a. return 0;
b. return a;
c. return a + b;
d. return a - b;
e. return a ^ b;
f. return (a << 16) | b; Q39 Which statements are true regarding the execution of the following code? public class Q3a0a { public static void main(String[] args) { int j = 5; for (int i = 0; i < j-- : i > 0;
System.out.println(i*j);
}
}
}
Select the two correct answers.
a. An AssertionError will be thrown if assertions are enabled at runtime.
b. The last number printed is 4 if assertions are disabled at runtime.
c. The last number printed is 20 if assertions are disabled at runtime.
d. The last number printed is 4 if assertions are enabled at runtime.
e. The last number printed is 20 if assertions are enabled at runtime.

Q40 Which of the following method names are overloaded?
Select the three correct answers.
a. The method name yield in java.lang.Thread
b. The method name sleep in java.lang.Thread
c. The method name wait in java.lang.Object
d. The method name notify in java.lang.Object

Q41 Which are valid identifiers?
Select the three correct answers.
a. _class
b. $value$
c. zer@
d. ångström
e. 2much

Q42 What will be the result of attempting to compile and run the following program?
public class Q28fd {
public static void main(String[] args) {
int counter = 0;
l1:
for (int i=0; i<10; i++) { l2: int j = 0; while (j++ < 10) { if (j > i) break l2;
if (j == i) {
counter++;
continue l1;
}
}
}
System.out.println(counter);
}
}
Select the one correct answer.
a. The program will fail to compile.
b. The program will not terminate normally.
c. The program will write 10 to the standard output.
d. The program will write 0 to the standard output.
e. The program will write 9 to the standard output.

Q43 Given the following interface definition, which definition is valid?
interface I {
void setValue(int val);
int getValue();
}
Select the one correct answer.

a. class A extends I {
int value;
void setValue(int val) { value = val; }
int getValue() { return value; }
}

b. interface B extends I {
void increment();
}

c. abstract class C implements I {
int getValue() { return 0; }
abstract void increment();
}

d. interface D implements I {
void increment();
}

e. class E implements I {
int value;
public void setValue(int val) { value = val; }
}

Q44 Which statements are true about the methods notify() and notifyAll()?
Select the two correct answers.
a. An instance of the class Thread has a method named notify that can be invoked.
b. A call to the method notify() will wake the thread that currently owns the lock of the object.
c. The method notify() is synchronized.
d. The method notifyAll() is defined in class Thread.
e. When there is more than one thread waiting to obtain the lock of an object, there is no way to be sure which thread will be notified by the notify() method.

Q45 Which statements are true about the correlation between the inner and outer instances of member classes?
Select the two correct answers.
a. Fields of the outer instance are always accessible to inner instances, regardless of their accessibility modifiers.
b. Fields of the outer instance can never be accessed using only the variable name within the inner instance.
c. More than one inner instance can be associated with the same outer instance.
d. All variables from the outer instance that should be accessible in the inner instance must be declared final.
e. A class that is declared final cannot have any member classes.

Q46 What will be the result of attempting to compile and run the following code?
public class Q6b0c {
public static void main(String[] args) {
int i = 4;
float f = 4.3;
double d = 1.8;
int c = 0;
if (i == f) c++;
if (((int) (f + d)) == ((int) f + (int) d)) c += 2;
System.out.println(c);
}
}
Select the one correct answer.
a. The code will fail to compile.
b. The value 0 will be written to the standard output.
c. The value 1 will be written to the standard output.
d. The value 2 will be written to the standard output.
e. The value 3 will be written to the standard output.

Q47 Which operators will always evaluate all the operands?
Select the two correct answers.
a. ||
b. +
c. &&
d. ? :
e. %

Q48 Which statement concerning the switch construct is true?
Select the one correct answer.
a. All switch statements must have a default label.
b. There must be exactly one label for each code segment in a switch statement.
c. The keyword continue can never occur within the body of a switch statement.
d. No case label may follow a default label within a single switch statement.
e. A character literal can be used as a value for a case label.

Q49 Which modifiers and return types would be valid in the declaration of a main() method that starts the execution of a Java standalone application?
Select the two correct answers.
a. private
b. final
c. static
d. int
e. abstract
f. String

Q50 Which of the following expressions are valid?
Select the three correct answers.
a. System.out.hashCode()
b. "".hashCode()
c. 42.hashCode()
d. ("4"+2).equals(42)
e. (new java.util.Vector()).hashCode()

Q51 Which statement regarding the following method definition is true?
boolean e() {
try {
assert false;
} catch (AssertionError ae) {
return true;
}
return false; // (1)
}
Select the one correct answer.
a. The code will fail to compile since catching an AssertionError is illegal.
b. The code will fail to compile since the return statement at (1) is unreachable.
c. The method will return true under all circumstances.
d. The method will return false under all circumstances.
e. The method will return true if and only if assertions are enabled at runtime.

Q52 If str denotes a String object with the string "73", which of these expressions will convert the string to the int value 73?
Select the two correct answers.
a. Integer.intValue(str)
b. ((int) str)
c. (new Integer(str)).intValue()
d. Integer.parseInt(str)
e. Integer.getInt(str)

Q53 Insert a line of code at the indicated location that will call the print() method in the Base class.
class Base {
public void print() {
System.out.println("base");
}
}
class Extension extends Base {
public void print() {
System.out.println("extension");

// Insert a line of code here.
}
}
public class Q294d {
public static void main(String[] args) {
Extension ext = new Extension();
ext.print();
}
}
Fill in a single line of code.

Q54 Given the following code, which statements are true?
public class Vertical {
private int alt;
public synchronized void up() {
++alt;
}
public void down() {
--alt;
}
public synchronized void jump() {
int a = alt;
up();
down();
assert(a == alt);
}
}
Select the two correct answers.
a. The code will fail to compile.
b. Separate threads can execute the up() method concurrently.
c. Separate threads can execute the down() method concurrently.
d. Separate threads can execute both the up() and down() method concurrently.
e. The assertion in the jump() method will not fail under any circumstances.

Q55 What will be written to the standard output when the following program is run?
public class Q03e4 {
public static void main(String[] args) {
String space = " ";
String composite = space + "hello" + space + space;
composite.concat("world");
String trimmed = composite.trim();
System.out.println(trimmed.length());
}
}
Select the one correct answer.
a. 5
b. 6
c. 7
d. 12
e. 13

Q56 Given the following code, which statements are true about the objects referenced through the fields i, j, and k, given that any thread may call the methods a(), b(), and c() at any time?
class Counter {
int v = 0;
synchronized void inc() { v++; }
synchronized void dec() { v--; }
}
public class Q7ed5 {
Counter i;
Counter j;
Counter k;
public synchronized void a() {
i.inc();
System.out.println("a");
i.dec();
}
public synchronized void b() {
i.inc(); j.inc(); k.inc();
System.out.println("b");
i.dec(); j.dec(); k.dec();
}
public void c() {
k.inc();
System.out.println("c");
k.dec();
}
}
Select the two correct answers.
a. i.v is guaranteed always to be 0 or 1.
b. j.v is guaranteed always to be 0 or 1.
c. k.v is guaranteed always to be 0 or 1
d. j.v will always be greater than or equal to k.v at any give time.
e. k.v will always be greater than or equal to j.v at any give time.

Q57 Which statements are true about casting and conversion?
Select the three correct answers.
a. Conversion from int to long does not need a cast.
b. Conversion from byte to short does not need a cast.
c. Conversion from float to long does not need a cast.
d. Conversion from short to char does not need a cast.
e. Conversion from boolean to int using a cast is not possible.

Q58 Which method declarations, when inserted at the indicated position, will not cause the program to fail during compilation?
public class Qdd1f {
public long sum(long a, long b) { return a + b; }
// Insert new method declarations here.
}
Select the two correct answers.
a. public int sum(int a, int b) { return a + b; }
b. public int sum(long a, long b) { return 0; }
c. abstract int sum();
d. private long sum(long a, long b) { return a + b; }
e. public long sum(long a, int b) { return a + b; }

Q59 The 8859-1 character code for the uppercase letter A is the decimal value 65. Which code fragments declare and initialize a variable of type char with this value?
Select the two correct answers.
a. char ch = 65;
b. char ch = '\65';
c. char ch = '\0041';
d. char ch = 'A';
e. char ch = "A";

Q60 What will be the result of executing the following program code with assertions enabled?
import java.util.*;
public class Q4d3f {
public static void main(String[] args) {
LinkedList lla = new LinkedList();
LinkedList llb = new LinkedList();
assert lla.size() == llb.size() : "empty";
lla.add("Hello");
assert lla.size() == 1 : "size";
llb.add("Hello");
assert llb.contains("Hello") : "contains";
assert lla.get(0).equals(llb.get(0)) : "element";
assert lla.equals(llb) : "collection";
}
}
Select the one correct answer.
a. Execution proceeds normally and produces no output.
b. An AssertionError with the message "size" is thrown.
c. An AssertionError with the message "empty" is thrown.
d. An AssertionError with the message "element" is thrown
e. An IndexOutOfBoundsException is thrown.
f. An AssertionError with the message "container" is thrown.

Q61 Which of these are keywords in Java?
Select the two correct answers.
a. Double
b. native
c. main
d. unsafe
e. default

Tuesday, April 14, 2009

Computer Network: MCQ

1. If a computer on the network shares resources for others to use, it is called ____
a. Server
b. Client
c. Mainframe
d. PC
Answer : a

2. Terminators are used in ______ topology.
a. Bus
b. Star
c. Mesh
d. Ring
Answer : a

3. In _____ topology, if a computer’s network cable is broken, whole network goes down.
a. Bus
b. Star
c. Mesh
d. Ring
Answer : a

4. For large networks, _______ topology is used.
a. Bus
b. Star
c. Ring
d. Tree
Answer : b

5. ISO stands for
a. International Standard Organization
b. International Student Organization
c. Integrated Services Organization
d. Indian Standard Organisation
Answer : a

6. ISO OSI model is used in
a. Stand alone PC
b. Network environment
c. Mini Computer
d. Mainframe
Answer : b

7. Network cable lies on _____ layer
a. Application
b. Network
c. Physical
d. Transport
Answer : c

8. ____ layer decides which physical pathway the data should take.
a. Application
b. Network
c. Physical
d. Session
Answer : c

9. ISDN is an example of ______ network
a. Circuit switched
b. Packet switched
c. Message Switched
d. Virtual Circuit Switched
Answer : a

10. X.25 is an example of ______ network
a. Circuit switched
b. Packet switched
c. Message Switched
d. Virtual Circuit Switched
Answer : b

11. _____________ allows LAN users to share computer programs and data.
a. Communication server
b. Print server
c. File server
d. Client-Server
Answer : c

12. Print server uses ________ which is a buffer that holds data before it is send to the printer.
a. Queue
b. Spool
c. Node
d. Host
Answer : b

13. A standalone program that has been modified to work on a LAN by including concurrency controls such as file and record locking is an example of____
a. LAN intrinsic software
b. LAN aware software
c. Groupware
d. LAN ignorant software
Answer : a

14. The ______ portion of LAN management software restricts access, records user activities and audit data etc.
a. Configuration management
b. Security management
c. Performance management
d. Authentication Management
Answer : b

15. What is the max cable length of STP?
a. 100 ft
b. 200 ft
c. 100 m
d. 200 m
Answer : d

16. What is the max data capacity of STP?
a. 10 mbps
b. 100 mbps
c. 1000 mbps
d. 10000 mbps
Answer : b

17. Which connector STP uses?
a. BNC
b. RJ-11
c. RJ-45
d. RJ-69
Answer : c

18. What is the central device in star topology?
a. STP server
b. Hub/switch
c. PDC
d. Router
Answer : b

19. What is max data capacity for optical fiber cable?
a. 10 mbps
b. 100 mbps
c. 1000 mbps
d. 10000 mbps
Answer : c

20. Which of the following architecture uses CSMA/CD access method?
a. ARCnet
b. Ethernet
c. ARPAnet
d. Sancharnet
Answer : b
______________________________________________________________________________________________

IT Fundamentals

1. All of the following are examples of real security and privacy risks EXCEPT:
A. hackers.
B. spam.
C. viruses.
D. identity theft.
Answer: B

2. A process known as ____________ is used by large retailers to study trends.
A. data mining
B. data selection
C. POS
D. data conversion
Answer: A

3. ____________terminals (formerly known as cash registers) are often connected to complex inventory and sales computer systems.
A. Data
B. Point-of-sale (POS)
C. Sales
D. Query
Answer: B

4. A(n) ____________ system is a small, wireless handheld computer that scans an item̢۪s tag and pulls up the current price (and any special offers) as you shop.
A. PSS
B. POS
C. inventory
D. data mining
Answer: A

5. The ability to recover and read deleted or damaged files from a criminal̢۪s computer is an example of a law enforcement specialty called:
A. robotics.
B. simulation.
C. computer forensics.
D. animation.
Answer: C

6. Which of the following is NOT one of the four major data processing functions of a computer?
A. gathering data
B. processing data into information
C. analyzing the data or information
D. storing the data or information
Answer: C

7. ____________ tags, when placed on an animal, can be used to record and track in a database all of the animal̢۪s movements.
A. POS
B. RFID
C. PPS
D. GPS
Answer: B

8. Surgeons can perform delicate operations by manipulating devices through computers instead of manually. This technology is known as:
A. robotics.
B. computer forensics.
C. simulation.
D. forecasting.
Answer: A

9. Technology no longer protected by copyright, available to everyone, is considered to be:
A. proprietary.
B. open.
C. experimental.
D. in the public domain.
Answer: A

10. ____________ is the study of molecules and structures whose size ranges from 1 to 100 nanometers.
A. Nanoscience
B. Microelectrodes
C. Computer forensics
D. Artificial intelligence
Answer: A

11. ____________ is the science that attempts to produce machines that display the same type of intelligence that humans do.
A. Nanoscience
B. Nanotechnology
C. Simulation
D. Artificial intelligence (AI)
Answer: D

12. ____________ is data that has been organized or presented in a meaningful fashion.
A. A process
B. Software
C. Storage
D. Information
Answer: D

13. The name for the way that computers manipulate data into information is called:
A. programming.
B. processing.
C. storing.
D. organizing.
Answer: B

14. Computers gather data, which means that they allow users to ____________ data.
A. present
B. input
C. output
D. store
Answer: B

15. After a picture has been taken with a digital camera and processed appropriately, the actual print of the picture is considered:
A. data.
B. output.
C. input.
D. the process.
Answer: B

16. Computers use the ____________ language to process data.
A. processing
B. kilobyte
C. binary
D. representational
Answer:

17. Computers process data into information by working exclusively with:
A. multimedia.
B. words.
C. characters.
D. numbers.
Answer:

18. In the binary language each letter of the alphabet, each number and each special character is made up of a unique combination of:
A. eight bytes.
B. eight kilobytes.
C. eight characters.
D. eight bits.
Answer: D

19. The term bit is short for:
A. megabyte.
B. binary language.
C. binary digit.
D. binary number.
Answer: C

20. A string of eight 0s and 1s is called a:
A. megabyte.
B. byte.
C. kilobyte.
D. gigabyte.
Answer:

21. A ____________ is approximately one billion bytes.
A. kilobyte
B. bit
C. gigabyte
D. megabyte
Answer: C

22. A ____________ is approximately a million bytes.
A. gigabyte
B. kilobyte
C. megabyte
D. terabyte
Answer: C

23. ____________ is any part of the computer that you can physically touch.
A. Hardware
B. A device
C. A peripheral
D. An application
Answer: A

24. The components that process data are located in the:
A. input devices.
B. output devices.
C. system unit.
D. storage component.
Answer: C

25. All of the following are examples of input devices EXCEPT a:
A. scanner.
B. mouse.
C. keyboard.
D. printer.
Answer: D

26. Which of the following is an example of an input device?
A. scanner
B. speaker
C. CD
D. printer
Answer: A

27. All of the following are examples of storage devices EXCEPT:
A. hard disk drives.
B. printers.
C. floppy disk drives.
D. CD drives.
Answer: B

28. The ____________, also called the â€Å“brainsâ€� of the computer, is responsible for processing data.
A. motherboard
B. memory
C. RAM
D. central processing unit (CPU)
Answer: D

29. The CPU and memory are located on the:
A. expansion board.
B. motherboard.
C. storage device.
D. output device.
Answer: B

30. Word processing, spreadsheet, and photo-editing are examples of:
A. application software.
B. system software.
C. operating system software.
D. platform software.
Answer:

31. ____________ is a set of computer programs used on a computer to help perform tasks.
A. An instruction
B. Software
C. Memory
D. A processor
Answer: B

32. System software is the set of programs that enables your computer̢۪s hardware devices and ____________ software to work together.
A. management
B. processing
C. utility
D. application
Answer: D

33. The PC (personal computer) and the Apple Macintosh are examples of two different:
A. platforms.
B. applications.
C. programs.
D. storage devices.
Answer: A

34. Apple Macintoshes (Macs) and PCs use different ____________ to process data and different operating systems.
A. languages
B. methods
C. CPUs
D. storage devices
Answer: C

35. Servers are computers that provide resources to other computers connected to a:
A. network.
B. mainframe.
C. supercomputer.
D. client.
Answer: A

36. Smaller and less expensive PC-based servers are replacing ____________ in many businesses.
A. supercomputers
B. clients
C. laptops
D. mainframes
Answer: D

37. ____________ are specially designed computers that perform complex calculations extremely rapidly.
A. Servers
B. Supercomputers
C. Laptops
D. Mainframes
Answer: B

38. DSL is an example of a(n) ____________ connection.
A. network
B. wireless
C. slow
D. broadband
Answer: D

39. The difference between people with access to computers and the Internet and those without this access is known as the:
A. digital divide.
B. Internet divide.
C. Web divide.
D. broadband divide.
Answer: A

40. ____________ is the science revolving around the use of nanostructures to build devices on an extremely small scale.
A. Nanotechnology
B. Micro-technology
C. Computer forensics
D. Artificial intelligence
Answer: A

41. Which of the following is the correct order of the four major functions of a computer?
A. Process à Output à Input à Storage
B. Input à Outputà Process à Storage
C. Process à Storage à Input à Output
D. Input à Process à Output à Storage
Answer:

42. ____________ bits equal one byte.
A. Eight
B. Two
C. One thousand
D. One million
Answer: A

43. The binary language consists of ____________ digit(s).
A. 8
B. 2
C. 1,000
D. 1
Answer:

44. A byte can hold one ____________ of data.
A. bit
B. binary digit
C. character
D. kilobyte
Answer: C

45. ____________ controls the way in which the computer system functions and provides a means by which users can interact with the computer.
A. The platform
B. The operating system
C. Application software
D. The motherboard
Answer: B

46. The operating system is the most common type of ____________ software.
A. communication
B. application
C. system
D. word-processing software
Answer: C

47. ____________ are specially designed computer chips that reside inside other devices, such as your car or your electronic thermostat.
A. Servers
B. Embedded computers
C. Robotic computers
D. Mainframes
Answer: B

48. The steps and tasks needed to process data, such as responses to questions or clicking an icon, are called:
A. instructions.
B. the operating system.
C. application software.
D. the system unit.
Answer: A

49. The two broad categories of software are:
A. word processing and spreadsheet.
B. transaction and application.
C. Windows and Mac OS.
D. system and application.
Answer: D

50. The metal or plastic case that holds all the physical parts of the computer is the:
A. system unit.
B. CPU.
C. mainframe.
D. platform.
Answer: A
________________________________________________________________________________________________

Monday, April 13, 2009

IT Fundamental

1. Which of the following is not used in First Generation Computers?
a. Vacuum tubes
b. Cards
c. Punch tapes
d. Magnetic cores

2. Which of the following is not associated with Second Generation Computers?
a. High level language
b. Operating system
c. Vacuum tubes
d. Transistor

3. Which of the following is true for the ENIAC machine?
a. Developed by Charles Babbage
b. Worked with stored programs
c. Used Vacuum tubes
d. Used electro-magnetic relays

4. The ALU is a part of
a. Operating system
b. CPU
c. ROM
d. None of these

5. Turbo C++ is a/an
a. Application software
b. Compiler
c. Interpreter
d. None of these

6. PARAM is a
a. Mini computer
b. Main-frame computer
c. Super computer
d. None of these

7. Digitization of continuous data is not necessary in
a. Mini computer
b. Main-frame computer
c. Super computer
d. Analog computer

8. Which of the following is not application software?
a. MS Word
b. PageMaker
c. Windows XP
d. Pro-Engineer

9. Which of the following is not a system file of MS DOS?
a. io.sys
b. msdos.sys
c. command.com
d. config.sys

10. A digital computer
a. Stores integer numbers in binary mode
b. Is less accurate than the analog computer
c. Can not store relation between continuous variables in the form of equations
d. All of these

11. Secondary storage of the computer is used for storing
a. Data only during the period when they are being processed by the CPU
b. Bilk data used by application programs
c. The operating system
d. All of these

12. Compared to secondary storage, primary storage is
a. Inexpensive but slow
b. Inexpensive but fast
c. Expensive and slow
d. Expensive but fast

13. The CPU performs read/write operations in
a. ROM
b. PROM
c. EPROM
d. RAM

14. The most popular secondary storage is
a. Magnetic tape
b. Magnetic core
c. Disk drive
d. RAM

15. Which of the following is volatile in nature?
a. ROM
b. RAM
c. PROM
d. All of these

16. Which of the following can be programmed only once?
a. ROM
b. PROM
c. EPROM
d. RAM

17. Disk drives are devices for
a. Sequential access of data
b. Overwriting of old data for storing new data
c. Faster data access as compared to magnetic tapes
d. All of these

18. Which of the following is most convenient for evaluating answer book with multiple choice questions?
a. MICR
b. OCR
c. OMR
d. Card reader

19. Which of the following produces best quality of printouts?
a. Dot-matrix Printer
b. Daisy-wheel Printer
c. Ink Jet Printer
d. Laser Printer

20. The primary memory of a personal computer consists of
a. ROM only
b. RAM only
c. ROM and RAM
d. ROM, RAM and Operating system

21. Different components of a computer are linked together by electrical conductors known as
a. Conductors
b. Buses
c. Connectors
d. Connecting leads

22. Which of the following converts digital signal into analog and analog signals to digital?
a. Fibre optic
b. Operating system
c. Modem
d. RAM

23. Conversion of analog signals to digital is known as
a. Modulation
b. Demodulation
c. Synchronization
d. Digitization

24. Half-duplex is a communication mode that facilitates data traffic
a. Always in one direction only
b. In one direction only, but the direction of data transfer can be set by the user
c. In both directions
d. In both directions but only in one direction at a time

25. A communication device that facilitates transmission from several input/output devices to a single line is known as a
a. Modifier
b. Modulator
c. Multiplexer
d. Duplex-system

26. A byte consists of
a. 2 bits
b. 8 bits
c. 32 bits
d. 1024 bits

27. Mode of communication in which data are transmitted in both directions, but not at the same time is known as
a. Simplex mode
b. Half-duplex mode
c. Full-duplex mode
d. None of these

28. The C compiler is
a. Part of the Operating system
b. A language translator
c. An interpreter
d. An application software

29. Which type of software facilitates creating, editing and printing of documents?
a. Word processing
b. Spreadsheets
c. Unix
d. Database management

30. Which of the following will convert instructions in a C program into the machine language?
a. System software
b. Operating system
c. Compiler
d. Interpreter

31. Instructions in a C program can be executed only when the program is
a. Assembled
b. Compiled
c. Assembled and Compiler
d. Compiled and linked with the library

32. A tuple in a database refers to a
a. Record
b. Field
c. File
d. Data item

33. A network model of database is useful as it
a. Facilitates physical representation of data
b. Allows one to many relationship
c. Easy to understand
d. Easy to store in a relational database

34. Which of the following is not true for a database system?
a. Eliminate data redundancy
b. Maintain data integrity
c. Allow to view and edit al files
d. Establish relation amongst records in the database

35. Programming language used in Database Management System is
a. C language
b. Query language
c. Cobol
d. None of these

36. The records of all activities in a specific period of time that requires updating the database is known as
a. Query report
b. Transaction file
c. Data manipulation file
d. Update file

37. Data items grouped together for storage in a file are called
a. Record
b. List
c. Grouped data
d. String

38. Which of the following is not a valid Dos command?
a. dir
b. dir>dfile
c. dir>>myfile
d. dir!

39. Which of the following is an external Dos command?
a. type
b. print
c. copy
d. format

40. What does command copy *.* a: do?
a. Copies all files in the working directory to floppy disk a:
b. Copies all files in the working directory and its sub-directories to floppy disk a:
c. Copies all files in c: drive to floppy disk a:
d. The command is illegal

41. Which of the following commands will delete a file named students.dat?
a. delete student.dat
b. del student.dat
c. remove student.dat
d. erase student.dat

42. Which of the following Boolean expressions is incorrect?
a. A+A’=1
b. A+0=A
c. A.1=A
d. AA’=1

43. According to Commutative law of Boolean algebra
a. X+Y=Y+X
b. X+(Y+Z)=(X+Y)+Z
c. X(Y.Z)=(X.Y)Z
d. X(Y+Z)=(XY)+(XZ)

44. Which of the following is correct Boolean expression?
a. X’.Y’+X.Y’+X.Y=Y+XY
b. X’.Y’+X.Y’+X.Y=Y’+XY
c. X’.Y’+X.Y’+X.Y=Y’+X’Y’
d. X’.Y’+X.Y’+X.Y=Y+X’Y’

45. What will be the output of the following logic circuit?



a. Q=A+B
b. Q=AB
c. Q=AB’
d. Q=A’+B’

46. Decimal number 136, in octal mode, is equivalent to
a. 209
b. 210
c. 211
d. 212

47. Which of the following is not a valid hexadecimal number?
a. 1AB
b. 2BC
c. 3FG
d. None of these

48. Decimal number 0.12 in octal mode is equivalent to
a. 0.375
b. 0.281
c. 0.015
d. None of these

49. Binary number 1110 is equivalent to 16 in
a. Octal system
b. Decimal system
c. Hexadecimal system
d. None of these

50. Which of the following does not form a part of Windows XP start menu?
a. Programs
b. Settings
c. Run
d. Edit

51. What happens when a user double clicks on the icon marked My Computer on desktop?
a. Icons for hard disk drives appear in a new window
b. Icons for hard disk and floppy disk drives appear in a new window
c. Icons for hard disk drives, floppy disk drives and CD ROM drives appear in a new window
d. Icons for installed programs appear in a new window

52. When a user deletes a file from the hard disk?
a. It is permanently erased from memory
b. It goes to the recycle bin and be retrieved at any time later
c. It goes to recycle bin and can be retrieved if the recycle bin has not been emptied
d. Any of the above can happen and the user has no control over it

53. Which of the following is not a tab in the menu bar of MS Word?
a. File
b. Edit
c. Format
d. Save

54. What value will the following C statement assign to integer variable k?
K = (5+3/2*2)*(5%3)
a. 10
b. 14
c. 4
d. None of these

55. Which of the following is not a key word in C?
a. default
b. break
c. file
d. switch

56. Suppose x and y have been declared as integer variables. Which of the following statement/s is/are illegal for reading values of x and y?
a. scanf(“%d,%d”,&x,&y)
b. scanf(“%d%d”,&x,&y)
c. scanf(“%d%d,&x;&y”)
d. scanf(“%d-%d”,&x,&y)

57. Suppose variables x and y hae been declared as integer and assigned respective values of 10 and 12. What output will the following statement give?
printf(“%d,%d,%X,%x\n”,x,y,x,y);
a. 10,12,10,12
b. 10,12,A,c
c. 10,12a,C
d. Statement is illegal

58. Which of the following is/are not valid C operand/operands?
a. 31stDecember
b. December31
c. _December31
d. _31stDecember

59. Which of the following is not valid format strings in C?
a. “%ud”
b. “%ux”
c. “%uo”
d. “%xd”

60. Suppose a has been declared as an integer variable and is assigned a value of 5. What output will the following statement give?
printf(“%d %d\n”,a++,++a);
a. 5,5
b. 5,6
c. 6,6
d. None of these

61. What will be the output of the following program?
if(‘A’)
printf(“abc”);
else
printf(“def”);
printf(“ghi\n”);
a. abc
b. def
c. defghi
d. abcghi

62. What will be the output of the following code if integer variables k and p are declared and initialized with values of 1 and 3, respectively?
int k=1;
int P=3;
switch(k)
{
case 1:
printf(“P”);
case 2:
printf(“P*P ”);
a. 3
b. 3 9
c. P
d. P P*P

63. What will be the output of the following code?
int p=3;
printf(“%d”,(p<3)?5/2:(int)’A’); a. 2 b. 2.5 c. A d. 65 64. The following function is written to evaluate the cube root of a real number. Identify the errors in the following code. Assume that header file is included
cuberoot(float x)
{
crx=pow(x,13);
return(cr);
}
a. It does not specify the return type
b. Variable crx has been used without being declared
c. To evaluate cube root of x, function pow() should be invoked as pow(x,1.0.3.0)
d. All of these

65. What will be the output of the following code?
char nextChar(char c)
{
return(c+1);
}
void main()
{
int i;
char ch=’P’;
for(i=0;i<5;i++) printf(“%c “, nextChar(ch)); } a. P Q R S T b. Q Q Q Q Q c. Q R S T U d. None of these 66. Which of the following are valid declarations of an array of integer numbers? Assume M has been declared as an integer variable and assigned a value of 10 a. int x[] b. int y[10] c. int z[M] d. All of these 67. In which header file is function exit() defined? a. stdio.h b. stdlib.h c. conio.h d. None of these 68. What will be the output of the following code? int x[10]={1,4,9,16,25}; printf(“%d\n”,x[3]); a. 9 b. 16 c. The code is illegal. The array should be declared as int x[]={1,4,9,16,25} d. The code illegal. The array should be declared as int x[5]={ 1,4,9,16,25}; 69. Which of the following declarations is/are illegal? a. int x[][]={{1,2,3},{3,4,5}} b. int y [2][3] ={{1,2,3},{3,4,5}} c. int z[][3] ={{1,2,3},{3,4,5}} d. int z[2][] ={{1,2,3},{3,4,5}} 70. Examine the following program #include
#include
double x;
void main()
{
int y;
for(x=y;x<5;x++) { double z; z=sqrt(x); printf(“Square root of %f is %f\n”,x,z); } } Which of the following is true? a. x and y are global variable b. y is a block variable c. x,y and z are auto variables d. All of these 71. A static variable has a. Local scope and visibility b. Local scope and global visibility c. Global scope and visibility d. Global scope and local visibility 72. For storage of a variable declared as float, one needs a. 2 bytes b. 4 bytes c. 6 bytes d. 8 bytes 73. What will be the output of the following code? enum size{ SMALL, MEDIUM, BIG} size mychoice=MEDIUM; printf(“%d\n”, mychoice==1); a. MEDIUM b. mychoice=MEDIUM c. 1 d. mychoice=1 74. Which of the following is/are valid escape sequence in C? a. ‘\a’ b. ‘\\’ c. ‘\t’ d. All of these 75. By default all variables in C are a. auto b. static c. external d. None of these 76. What will be the output of the following program? #include
#include
void main()
{
char str1[10]={“uvw”};
char str2[10]={“xyz”};
printf(“%s %s %s\n”,strcat(str1,str2),str1,str2);
}
a. uvw xyz uvw xyz
b. uvwxyz uvw xyz
c. uvwxyz uvwxyz xyz
d. None of these

77. What will be the output of the following program?
#include
#define RECIPROCAL(x)1/(float)x
void main()
{
printf(“%f\n”,RECIPROCAL(4+1));
}
a. 0.2
b. 1.25
c. 0
d. None of these

78. Which of the function will convert string str into uppercase?
a. toupper(str)
b. strupr(str)
c. upper(str)
d. stringupr(str)

79. A structure rectangle is defined with two data members length and breadth. If R is a structure of type Rectangle, its length can be accessed as
a. R.length
b. R->length
c. length.R
d. length->R

80. A structure Circle is defined with float variable radius as its only data member. The following code assigns values to data member radius of circle C and defines a pointer variable ptr to point to the address of Circle C
Circle C;
C.radius=5;
Circle *ptr;
ptr=&c;
The radius of the circle can be accessed by the following code
a. ptr.radius
b. ptr->radius
c. C->radius
d. C.radius

81. Suppose a pointer variable ptr is declared as int *p; the following code allocates memory for storing an integer number at address p
a. p=malloc(2)
b. p=(int*)malloc(2)
c. p=malloc(sizeof(int))
d. p=(int*)malloc(sizeof(int))

82. Function fopen() returns
a. void
b. 0 if successful and non zero integer number otherwise
c. A pointer to the file opened
d. None of these

83. Suppose it is required to write a string pointed to by pointer str to a file whose pointer is fptr. The following will write the string to the file
a. fputs(fptr,str)
b. puts(str,fptr)
c. fputs(str,fptr)
d. None of these

84. Function prototype of function fseek() is
a. void fseek(FILE*fp, int offset, int whence)
b. void fseek(FILE*fp, long offset, int whence)
c. int fseek(FILE*fp, int offset, int whence)
d. int fseek(FILE*fp, long offset, int whence)

85. Function fwrite() returns
a. Number of characters written to a file
b. Number of records written to a file
c. Number of bytes written to a stream
d. Does not return anything. It is a void function

86. What will be the output of the following code?
char str[]=”pqrst”;
cout<<<<<14.4567352<
a. pqr 14.4567352
b. pqr 14.4567
c. pqrst 14.46
d. pqrst 14.4567352

87. Statement coud<<<234 requires the following header files to be included
a. iostream.h
b. iostream.h and stdio.h
c. iostram.h and iomanip.h
d. stdio.h, stdlib.h and iostram.h

88. Bydefault, data members of a class are
a. private
b. protected
c. public
d. There is no default. All data members are to be explicitly declared as private, protected or public

89. Which of the following is true?
a. Constructor function of a class has a name same as a class name
b. Constructor of the class is automatically invoked when an object of the class is created
c. Constructor function can not return a value
d. Every class must have a constructor

90. Which of the following is true?
a. A C++ class can have more than one constructor
b. A C++ class can have more than one function with the same name
c. A class can be defined with default function argument
d. All member functions of a class, bydefault, are private



Solutions:

1. (d) 2.(c) 3.(c) 4.(b) 5.(b)

6.(c) 7.(d) 8.(c) 9.(d) 10.(a)

11.(b) 12.(d) 13.(d) 14.(c) 15.(b)

16.(a) 17.(d) 18.(c) 19.(d) 20.(c)

21.(b) 22.(c) 23.(a) 24.(d) 25.(c)

26.(b) 27.(b) 28.(b) 29.(a) 30.(c)

31.(d) 32.(a) 33.(b) 34.(c) 35.(b)

36.(b) 37.(a) 38.(d) 39.(b) 40.(a)

41.(a) 42.(d) 43.(a) 44.(b) 45.(c)

46.(b) 47.(c) 48.(d) 49.(a) 50.(d)

51.(c) 52.(c) 53.(d) 54.(b) 55.(c)



56.(c) 57.(b) 58.(a) 59.(d) 60.(c)

61.(c) 62.(d) 63.(d) 64.(d) 65.(b)

66.(a) & (b) 67.(b) 68.(b) 69.(a) & (d) 70.(b) & (c)

71.(d) 72.(b) 73.(c) 74.(d) 75.(a)

76.(c) 77.(b) 78.(b) 79.(a) 80.(b) & (d)

81.(b) & (c) 82.(d) 83.(c) 84.(d) 85.(c)

86.(c) 87.(c) 88.(a) 89.(a),(b) & (c) 90.(a),(b) & (c)

Friday, April 10, 2009

Data Communication-II

1. The Internet model consists of ________ layers.
a. Three
b. Five
c. Seven
d. Eight

2. The process-to-process delivery of the entire message is the responsibility of the ________ layer.
a. Network
b. Transport
c. Application
d. Physical

3. The ________ layer is the layer closest to the transmission medium.
a. Physical
b. Data link
c. Network
d. Transport

4. Mail services are available to network users through the ______ layer.
a. Data link
b. Physical
c. Transport
d. Application

5. As the data packet moves from the lower to the upper layers, headers are _______
a. Added
b. Subtracted
c. Rearranged
d. Modified

6. As the data packet moves from the upper to the lower layers, headers are ________
a. Added
b. Removed
c. Rearranged
d. Modified

7. The ________ layer lies between the network layer and the application layer.
a. Physical
b. Data link
c. Transport
d. None of the above

8. Layer 2 lies between the physical layer and the ________ layer.
a. Network
b. Data link
c. Transport
d. None of the above

9. When data are transmitted from device A to device B, the header from A’s layer 4
is read by B’s ________ layer.
a. Physical
b. Transport
c. Application
d. None of the above

10. The ________ layer changes bits into electromagnetic signals.
a. Physical
b. Data link
c. Transport
d. None of the above

11. The physical layer is concerned with the transmission of _______ over the
physical medium.
a. Programs
b. Dialogs
c. Protocols
d. Bits

12. Which layer functions as a liaison between user support layers and network

support layers?
a. Network layer
b. Physical layer
c. Transport layer
d. Application layer

13. What is the main function of the transport layer?
a. Node-to-node delivery
b. Process-to-process delivery
c. Synchronization
d. Updating and maintenance of routing tables

14. Which of the following is an application layer service?
a. Remote log-in
b. File transfer and access
c. Mail service
d. All the above

Solution:

1.(a) 2.(b) 3.(a) 4.(d) 5.(a) 6.(b) 7.(c)

8.(a) 9.(b) 10.(a) 11.(d) 12.(c) 13.(b) 14.(d)

Data Communication-I

1. A network that spans a large city is known as a(n) ___________.
a. WAN
b. LAN
c. P2PN
d. MAN

2. The token ring network controls access to the network using ___________.
a. token passing
b. broadcast transmission
c. bus
d. facsimile technology

3. The environment in which most of the processing is done by the server is known as ___________.
a. client/server
b. peer-to-peer
c. EDI
d. file/server

4. One or more computers connected to a hub in a network are known as __________ topology.
a. bus
b. ring
c. star
d. mesh

5. The network type in which all computers have equal status is known as _____________.
a. client/server
b. communications link
c. peer-to-peer
d. LAN

6. Microwave transmission, fiber optics and twisted pairs are examples of ___________.
a. topologies
b. communication links
c. network devices
d. computer networks

7. Signals produced by a computer to be sent over to phone lines must be converted to ______________.
a. digital signals
b. analog signals
c. microwaves
d. radio waves

8. A network that has all nodes on a single cable is known as _______________.
a. bus
b. star
c. ring
d. mesh

9. Devices that transmit and receive satellite signals are known as ____________.
a. earth stations
b. tokens
c. workstations
d. servers

10. The physical layout of a LAN is known as ______________.
a. link
b. network
c. contention
d. topology

11. All of the following are examples of computer networks EXCEPT:
a. L2AN
b. P2PN
c. MAN
d. WAN

12. Which of the following is the most widely used packet switching protocol for WAN application?
a. Ethernet
b. X.25
c. T1
d. TCP/IP

13. Which term describes a computer that is connected to a network?
a. node
b. unit
c. device
d. terminal unit

14. What is the term used to describe the phenomenon when two computers try to send data at the same time using the same network?
a. contention
b. congestion
c. competition
d. communication

15. Which of the following is a WAN connection point that enables users to access the WAN using a local phone call?
a. POP
b. Leased line
c. PVC
d. ISDN

16. To connect to a LAN, a computer must be equipped with _______________.
a. backbone
b. network card
c. both a and b
d. none of the above

17. Which technology enables networks to transmit messages to their correct destination?
a. Packet switching
b. Circuit switching
c. Both a and b
d. None of the above

18. Two examples of ______________ are cable television lines and telephone lines.
a. communication channels
b. communication devices
c. sending devices
d. receiving devices

19. Internet transmissions usually use ______________.
a. Bluetooth
b. Ethernet
c. TCP/IP
d. broadcast transmission

20. Because of its larger size, most ___________ networks require a network administrator.
a. P2P
b. file/server
c. client/server
d. local

21. Sending and receiving devices include _________________.
a. tablet PCs, PDAs, and smart phones
b. mainframes computers and servers
c. desktop computers and notebook computers
d. all of the above

Search Aptipedia