You are on page 1of 88

June 2012 - Paper II

Hey everyone, back after a two day break. Since we are done with December 2010 paper, I want to choose the next one and it would be June 2012 now. From June 2012, Paper-II and Paper-III are objective so we will do with paper-II first and then get on to paper-III. Like all other solutions, it is all about understanding the answer and arriving at it conclusively, so that we can learn something out of it which can be used in another situation. It is never about simply remembering the answer for every question. It is all about understanding it. That is why i am spending some time going through the explanation for answering every question. Infact i wanted to do only one question a day, but that way we would take a lot of time in finishing the solutions for the question papers and so i try to answer more than one question. Okay, without wasting much of time, let us start. 1. The postfix expression AB + CD * can be evaluated using a (A) stack (B) tree (C) queue (D) linked list Ans:-A Explanation:-This is a simple question. The postfix expression can be evaluated using a stack. First the operands are pushed into the stack and the moment a operator is encountered, operands are popped out, operation performed on the operands and the result once again pushed into the stack. This series of activities continue till the entire expression is not evaluated. So the answer is A.

2. The post order traversal of a binary tree is DEBFCA. Find out the pre- order traversal. (A) ABFCDE (B) ADBFEC (C) ABDECF (D) None of the above Ans:-C Explanation:A binary tree is a data structure which has at most two child nodes. A binary tree can be traversed in three ways. Inorder, preorder and postorder. The three methods of traversal can be explained this way. TYPE FIRST SECOND THIRD Inorder L - Left Ro - Root R - Right Preorder Ro - Root L - Left R - Right
1

Postorder L - Left

R - Right Ro - Root

Left will always be followed by right. But Root would be either in the front or in the middle or at the last depending on whether it is pre, in or postorder traversal. So given a post order traversal of a binary tree, we can know the root first. In the question, the post order traversal is given as DEBFCA. Since Root is the last node to be traversed in a post order traversal we know one thing for sure. A is the root. Next, we are left with only DEBFC. Here some of the nodes belong to the left side of the binary tree and some belong to the right side. How many nodes belong to the left and how many belong to the right. Since left side of the binary tree is considered first, and since every node is expected to have at most two child, DEB will be the left side of the binary tree and FC would be the right. Now, we know that FC is in the right side of the binary tree. Again the last node would be the root of the sub tree and F its left side. Next we come to the left side of the binary tree and it is DEB. Again B would be the root of the sub tree. D and E are its left and right side respectively. So the binary tree would look something like this given below.

After constructing the binary tree, writing the preorder traversal is very simple. In preorder traversal root comes first. Since A is the root, A would appear first. Following Root would be the Left and Right sub tree and so the left subtree would be BDE. Again B would be the root of the
2

left sub tree followed by D and E which are the left and right child respectively. SO the preorder traversal till now would be ABDE. Last comes the Right sub tree. Here again C would be the root of the right sub tree followed by C its left child. So the entire preorder traversal of the tree would be ABDECF. So option C is the right answer. 3.The branch logic that provides making capabilities in the control unit is known as (A) Controlled transfer (B) Conditional transfer (C) Unconditional transfer (D) None of the above Ans:-A Explanation:- This question is available in lot of websites and other materials and the answer given there is unconditional transfer which is option C. But UGC answer key is given as option A. I am just going to go with A, but will find out more about this and post it. Meanwhile, if there are any explanation for this question,please post it, so that everyone can benefit.

DECEMBER 2011 - PAPER II(Q.N0 36 - 50)


36. X = Y + 1 means (A) X=X Y +1 (B) X = X Y 1 (C) X=X+Y+1 (D) X=X Y 1 Ans:-D

37. Handoff is the mechanism that (A) transfer an ongoing call from one base station to another (B) initiating a new call (C) dropping an ongoing call (D) none of above Ans:-A

38. Which one of the following statement is false ? (A) Context-free languages are closed under union.
3

(B) Context-free languages are closed under concatenation. (C) Context-free languages are closed under intersection. (D) Context-free languages are closed under Kleene closure. Ans:-C Explanation:- CFL's are closed under union, concatenation, and Kleene closure. But not under intersection or difference. So the correct answer is option C.

39. All of the following are examples of real security and privacy risks except (A) Hackers (B) Spam (C) Viruses (D) Identify theft Ans:-B

40. Identify the incorrect statement : (A) The ATM adoption layer is not service dependent. (B) Logical connections in ATM are referred to as virtual channel connections. (C) ATM is streamlined protocol with minimal error and flow control capabilities (D) ATM is also known as cell delays. Ans:-A

41. Software risk estimation involves following two tasks : (A) Risk magnitude and risk impact (B) Risk probability and risk impact (C) Risk maintenance and risk impact (D) Risk development and risk impact Ans:-B

42. The number of bits required for an IPV6 address is (A) 16 (B) 32 (C) 64 (D) 128
4

Ans:-D

43. The proposition ~ qvp is equivalent to (A)pq (B) qp (C) pq (D) pq Ans:-B

44. Enterprise Resource Planning (ERP) (A) has existed for over a decade. (B) does not integrate well with the functional areas other than operations. (C) is inexpensive to implement. (D) automate and integrates the majority of business processes. Ans:-D

45. Which of the following is false concerning Enterprise Resource Planning (ERP) ? (A) It attempts to automate and integrate the majority of business processes. (B) It shares common data and practices across the enterprise. (C) It is inexpensive to implement. (D) It provides and access information in a real-time environment. Ans:-C

46. To compare, overlay or cross analyze to maps in GIS (A) both maps must be in digital form (B) both maps must be at the same equivalent scale. (C) both maps must be on the same coordinate system (D) All of the above Ans:-D

47. Web Mining is not used in which of the following areas ? (A) Information filtering
5

(B) Crime fighting on the internet (C) Online transaction processing (D) Click stream analysis. Ans:-B

48. A telephone conference call is an example of which type of communications ? (A) same time / same place (B) same time / different place (C) different time / different place (D) different time / same place Ans:-B

49. What is the probability of choosing correctly an unknown integer between 0 and 9 with 3 chances ? (A) 963/1000 (B) 973/1000 (C) 983/1000 (D) 953/1000 Ans:-A The number of nodes in a complete binary tree of height h (with roots at level 0) is equal to (A) 20 + 21 + ..... 2h (B) 20 + 21 + ..... 2h 1 (C) 20 + 21 + ..... 2h + 1 (D) 21 + ..... 2h + 1 Ans:-A

JUNE 2012 - PAPER III


1. Consider the following pseudocode segment : K:=0 for i1:= l to n for i2:= 1 to i1 : : : for im:= 1 to im1
6

K:= K+1 The value of K after the execution of this code shall be (A) C(n + m 1, m) (B) C(n m + 1, m) (C) C(n + m 1, n) (D) C(n m + 1, n) Ans:-A

In order to understand the solution to this problem let us consider some sample value of n and m. Let us say n=3 and m=2. The value of m also decides the number of inner loops we have. When we say m=2, the total number of loops we have is 2 only. n decides the range of the outer most loop. So the pseudocode can be understood as, K:=0 for i:= 1 to n for m:= 1 to i K:=K+1 For the value of n=3 and m=2, the value of K would be incremented in the following manner.

i mK 11 1 21 2 22 3 31 4 32 5 33 6 The value of i ranges from 1 to n where n=3. The value of K is K:=6 at the end of the iterations. Substituting the value of n and m in the options given as the answer let us take option A. C(n+m-1,m)=C(3+2-1,2)=C(4,2)=4!/2!*2!=6. So the answer for this question is option A. 2. In Delta Rule for error minimization (A) weights are adjusted w.r.to change in the output (B) weights are adjusted w.r.to difference between desired output and actual output (C) weights are adjusted w.r.to difference between input and output (D) none of the above Ans:-B

Explanation:- The topic comes in Artificial Neural Networks(ANN). In this rule weights are adjusted with respect to difference between desired output and actual output.

3. The concept of pipelining is most effective in improving performance if the tasks being performed in different stages : (A) require different amount of time (B) require about the same amount of time (C) require different amount of time with time difference between any two tasks being same (D)require different amount of time with time difference between any two tasks being different Ans:-B Explanation:In the same June 2012 -Paper II, Question No 48 is based on pipelining and i have explained the same there. Please refer to it.

JUNE 2012 - PAPER III


4. What is Granularity ? (A) The size of database (B) The size of data item (C) The size of record (D) The size of file Ans:-B Explanation:- Granularity refers to the size of any data item. It could be a tuple, relation, database,anything. So the option is B.

5. Suppose that a given application is run on a 64-processor machine and that 70 percent of the application can be parallelized. Then the expected performance improvement using Amdahl s law is (A) 4.22 (B) 3.22 (C) 3.32 (D) 3.52 Ans:-B

Explanation:According to Amdahl's law, in case of parallelization,if P is the proportion of the program that can be made parallel, then (1-P) is the proportion that cannot be parallelized. Then the maximum speedup that can be achieved by using N processor is, S(N)=1/(1-P)+P/N where N refers to the no of processors, and P refers to the proportion that can be parallelized. In the question above, no of processor, N=64 The proportion of the program that can be made parallel, P = 70%=0.7 So, substituting in the formula, we get, 1/(1-0.7)+0.7/64=1/0.3+0.0109375=1.0.310975 =3.215 =3.22 Therefore, the option is B. 6. If two fuzzy sets A and B are given with membership functions A(x) = {0.2, 0.4, 0.8, 0.5, 0.1} B(x) = {0.1, 0.3, 0.6, 0.3, 0.2} Then the value of willbe AB (A) {0.9, 0.7, 0.4, 0.8, 0.9} (B) {0.2, 0.4, 0.8, 0.5, 0.2} (C) {0.1, 0.3, 0.6, 0.3, 0.1} (D) {0.7, 0.3, 0.4, 0.2, 0.7} Ans:-A Explanation:The fuzzy intersection of two fuzzy sets A and B on universe of discourse X: AB(x) = min [A(x), B(x)] , where xX But here in the question, they are asking for complement of AintersectionB and so the answer would be 1-min[A(x),B(x)]. The minimum of 0.2 and 0.1 will be 0.1, and 1-0.1 will be 0.9. The second value is min(0.4,0.3)=0.3 and 1-0.3=0.7 The third value is min(0.8,0.6)=0.6 and 1-0.6=0.4 The fourth value is min(0.5,0.3)=0.3 and 1-0.3=0.7 The last value is min(0.1,0.2)=0.1 and 1-0.1=0.9 The only option which has got the values 0.9,0.7,0.4,0.7 and 0.9, although the fourth value is given as 0.8 instead of 0.7 is option A. So the answer is option A.

Thursday, 27 September 2012

DECEMBER 2011 - PAPER II

28. On receiving an interrupt from an I/O device, the CPU (A) halts for predetermined time (B) branches off to the interrupt service routine after completion of the current instruction

(C) branches off to the interrupt service routine immediately. (D) hands over control of address bus and data bus to the interrupting device.

Ans:-B

29. The maximum amount of information that is available in one portion of the disk access arm for a removal disk pack (without further movement of the arm with multiple heads) (A) a plate of data (B) a cylinder of data (C) a track of data (D) a block of data

Ans:-B

30. Consider a logical address space of 8 pages of 1024 words mapped with memory of 32 frames. How many bits are there in the physical address ? (A) 9 bits (B) 11 bits (C) 13 bits (D) 15 bits

Ans:-D Explanation:The question asks about the number of bits in the physical address. The word size is 1024. So, the number of bits required to calculate the offset into each page = 210=1024=10 bits. So for 32 frames(25) of 1024 words each,we would require a total of 5+10 bits = 15 bits. Therefore the option is D.

31. CPU does not perform the operation (A) data transfer (B) logic operation (C) arithmetic operation (D) all of the above

10

Ans:-D

32. A chip having 150 gates will be classified as (A) SSI (B) MSI (C) LSI (D) VLSI

Ans:-B Explanation:- The number of gates for the different classification are as follows. Small Scale Integration(SSI) - <10 Medium Scale Integration(MSI) - between 10 to 1000 Large Scale Integration(LSI) - >1000 Very Large Scale Integration(VLSI) - >100000 So the answer is option B.

33.If an integer needs two bytes of storage, then the maximum value of unsigned integer is (A) 216 1 (B) 215 1 (C) 216 (D) 215

Ans:-A Explanation:- The same question is asked in June 2012,paper -II but there they have asked for the maximum value of signed integer.The link to that answer is JUNE 2012 - PAPER II. Here it is the maximum value of unsigned integer and the answer is option A.

34. Negative numbers cannot be represented in (A) signed magnitude form (B) '1 s complement form (C) '2 s complement form (D) none of the above

Ans:-D
11

Explanation:Negative numbers can be represented in signed magnitude form, or '1' complement form or '2''s complement form. So the option is D.

35. The cellular frequency reuse factor for the cluster size N is (A) N (B) N2 (C) 1/N (D) 1/N2

Ans:-C

Posted by Vani Chakraborty at 05:40 3 comments: Email ThisBlogThis!Share to TwitterShare to Facebook

Wednesday, 26 September 2012

DECEMBER 2011 - PAPER II

22. Which command classes text file, which has been created using SET ALTERNA TIVE Command ? (A) SET ALTERNATE OFF (B) CLOSE DATABASE (C) CLOSE ALTERNATE (D) CLEAR ALL

Ans:-A Explanation:Actually the question should be which command is used for closing the text file, which has been created using SET ALTERNATE TO . The answer is SET ALTERNATE OFF. SET ALTERNATE ON directs the output to text file. OFF disables the output to text file.

23. Data security threats include

12

(A) privacy invasion (B) hardware failure (C) fraudulent manipulation of data (D) encryption and decryption

Ans:-C Explanation:Option B and D are completely ruled out. Since the question talks about data security threat choosing option C is correct than option A.

24. Which of the following statements is true, when structure of database file with 20 records is modified ? A) ? EOF ( ) Prints. T (B) ?BOF()Prints F (C) ?BOF()Prints T (D) ?EOF()Prints F

Ans:-A

25. The SQL Expression Select distinct T. branch name from branch T, branch S where T. assets > S. assets and S. branch-city = DELHI, finds the name of (A) all branches that have greater asset than any branch located in DELHI. (B) all branches that have greater assets than allocated in DELHI. (C) the branch that has the greatest asset in DELHI. (D) any branch that has greater asset than any branch located in DELHI.

Ans:-A

26. Dijkestra banking algorithm in an operating system, solves the problem of (A) deadlock avoidance (B) deadlock recovery (C) mutual exclusion (D) context switching

13

Ans:-A

27. The multiuser operating system, 20 requests are made to use a particular resource per hour, on an average the probability that no request are made in 45 minutes is (A) e-15 (B) e-5 (C) 1-e-5 (D) 1-e-10

Ans:-A

Posted by Vani Chakraborty at 04:57 No comments: Email ThisBlogThis!Share to TwitterShare to Facebook

Tuesday, 25 September 2012

DECEMBER 2011 - PAPER II

11. A station in a network forward incoming packets by placing them on its shortest output queue. What routing algorithm is being used ? (A) Hot potato routing (B) Flooding (C) Static routing (D) Delta routing

Ans:-A

12. Start and stop bits are used in serial communications for (A) Error detection (B) Error correction (C) Synchronization (D) Slowing down the communication 14

Ans:-C

13. For a data entry project for office staff who have never used computers before (user interface and user- friendliness are extremely important), one will use (A) Spiral model (B) Component based model (C) Prototyping (D) Waterfall model

Ans:-C

14. An SRS (A) establishes the basis for agreement between client and the supplier. (B) provides a reference for validation of the final product. (C) is a prerequisite to high quality software. (D) all of the above.

Ans:-D

15. McCabe s cyclomatic metric V(G) of a graph G with n vertices, e edges and p connected component is (A) e (B) n (C) e n +p (D) e n + 2p

Ans:-C Explanation:The cyclomatic number V(G) of a graph with n vertices, e edges and p connected component is V(G) = e - n + p

15

16. Emergency fixes known as patches are result of (A) adaptive maintenance (B) perfective maintenance (C) corrective maintenance (D) none of the above

Ans:-C

17. Design recovery from source code is done during (A) reverse engineering (B) re-engineering (C) reuse (D) all of the above

Ans:-A

18. Following is used to demonstrate that the new release of software still performs the old one did by rerunning the old tests : (A) Functional testing (B) Path testing (C) Stress testing (D) Regression testing

Ans:-D

19. The post order traversal of a binary tree is DEBFCA. Find out the pre- order traversal. (A) ABFCDE (B) ADBFEC (C) ABDECF (D) ABDCEF

Ans:-C

16

Explanation:- The same question is given in Paper II of June 2012 and i have explained the same in this blog. Please refer to paper ii - question no 2 of June 2012 paper.The link is given below JUNE 2012 - PAPER II

20. B + tree are preferred to binary tree in database because (A) Disk capacities are greater than memory capacities (B) Disk access much slower than memory access (C) Disk data transfer rates are much less than memory data transfer rate (D) Disk are more reliable than memory

Ans:-B Explanation:- Again the same question is repeated in June 2012 paper and the answer is B. Explanation for the same is provided there. In Question no 11 of paper ii - june 2012.The link is June 2012 - PAPER II

21. What deletes the entire file except the file structure ? (A) ERASE (B) DELETE (C) ZAP (D) PACK

Ans:-C Explanation:- Again this question is given in June 2012 paper-ii. Since i have solved june 2012paper II before the answer for the same is available there also. Question No 9 of June 2012-Paper II.

Posted by Vani Chakraborty at 03:42 No comments: Email ThisBlogThis!Share to TwitterShare to Facebook

Monday, 24 September 2012

DECEMBER 2011 - PAPER II

17

6. A hash table has space for 75 records, then the probability of collision before the table is 6% full (A) .25 (B) .20 (C ).35 (D).30

Explanation: The answer which i am getting out of calculation is not available in any of the options given here. Anyhow i will go ahead and give the explanation for the same. The hash table has space for 75 records. So let us say n=75. We have to calculate the probability of collision before the table is 6% full. If the table is 6% full, then 5 slots are occupied in the table. Since it is given before the table is 6% full, let us take the occupying items as 4. Let us calculate the probability of n collision and then subtract them from 1 to get the final answer. Prob. of no collision on first insertion = 1 Prob. of no collision on 2nd insertion=(n-1)/n=74/75 Prob. of no collision on 3rd insertion=(n-2)/n=73/75 Prob. of no collision on 4th insertion=(n-3)/n=72/75 So the probability of no collision on any of m insertions is the product of these values which is =1 * 0.987 * 0.973 * 0.96* 0.947 = 0.873 So the likelihood of at least one collision is just 1 minus this value. =1-0.873 = 0.123 which seems to be the answer. But there is no option like this at all. So i am not answering this question.

7. BCC in the internet refers to (A) Black carbon copy (B) Blind carbon copy (C) Blank carbon copy (D) Beautiful carbon copy Ans:- B

8.Hub is a term used with (A) A Star Networks (B) A Ring Networks (C) A Router (D) A Bridge
18

Ans:-A Explanation:In network topology, a star network is one where each host is connected to a central hub via a point-topoint link. It is considered a s the easiest topology to design and implement. It is also very easy to add nodes. But the disadvantage is that the hub represents a single point of failure. If the hub is down then the entire network becomes down.

9.The amount of uncertainty in a system of symbol is called (A) Bandwidth (B) Entropy (C ) Loss (D) Quantum Ans:- B

10. Which of the following network access standard disassembler is used for connection station to a packet switched network ? (A) X.3 (B) X.21 (C) X.25 (D) X.75 Ans:- C Explanation:X.25 is used in packed switched network. The idea is to connect a dumb terminal to a packet-switched network. Posted by Vani Chakraborty at 06:09 3 comments: Email ThisBlogThis!Share to TwitterShare to Facebook

Thursday, 20 September 2012

DECEMBER 2011 - PAPER II


4. Domain and Range of the function Y= sqrt(2x+3)is (A) x3/2,y0 19

(B) x>3/2,y<=0 (C) x3/2,y0 (D) x3/2,y0

Ans:-D Explanation:- Since i am not such a mathematical person, i am just giving you the link from where you can get the explanation for this answer. The same problem along with how to arrive at the answer is given in purple math. The link is, http://www.purplemath.com/modules/fcns2.htm

5. Maximum number of edges in a n- Node undirected graph without self loop is (A) n2 (B) n(n-1) (C) n(n + 1) (D) n(n-1)/2

Ans:-D Explanation:Theorem. In an undirected simple graph with N vertices without loops, there are at most N(N-1)/2 edges. This can be proved by induction. This can also be verified by drawing some simple graphs of 2,3, 4 and 5 vertices. But No multiple edges. So the answer is option D.

Posted by Vani Chakraborty at 05:54 No comments: Email ThisBlogThis!Share to TwitterShare to Facebook

Wednesday, 19 September 2012

DECEMBER 2011 - PAPER II


1. Which of the following data structure is Non-linear type ? (A) Strings (B) Lists (C) Stacks (D) None of the above 20

Ans:-D Explanation:- In Linear type data can be traversed sequentially. For example, arrays, linked list. In non linear type data is traversed in a non-sequential,hierarchal manner. Example are trees, Binary search trees etc. So option D will be the correct answer.

2. The total number of comparisons in a bubble sort is (A) 0(log n) (B) 0(n log n) (C) 0(n) (D) None of the above

Ans:-D Explanation:The total number of comparisons in a bubble sort is =(N-1)+(N-2)++2+1 =(N-1)*N/2=O(N2) Since this value is not available in the list of options,we go with D.

3. Which of the following is a bad example of recursion ? (A) Factorial (B) Fibonacci numbers (C) Tower of Hanai (D) Tree traversal

Ans:-B

Posted by Vani Chakraborty at 05:28 No comments: Email ThisBlogThis!Share to TwitterShare to Facebook

Tuesday, 18 September 2012

JUNE 2012 - PAPER II

21

37. Interrupts which are initiated by an instruction are (A) Internal (B) External (C) Hardware (D) Software

Ans:-D Explanation:- There are three types of interrupts. They are


1. External interrupts 2. Internal interrupts 3. Software interrupt External interrupts come from I/O devices. Internal interrupts are from illegal or wrong use of an instruction or data. A software interrupt is initiated by executing an instruction. The answer key gives the answer as C. But i think it should be D.

38. printf(%c, 100); (A) prints 100 (B) prints ASCII equivalent of 100 (C) prints garbage (D) none of the above

Ans:-B Explanation:- The %c format specifier prints the ascii equivalent of the value.

39. For the transmission of the signal, Bluetooth wireless technology uses (A) time division multiplexing (B) frequency division multiplexing (C) time division duplex (D) frequency division duplex

Ans:-C

22

40. Consider the following statements : I. Recursive languages are closed under complementation. II. Recursively enumerable languages are closed under union. III. Recursively enumerable languages are closed under complementation. Which of the above statements are true ? (A) I only (B) I and II (C) I and III (D) II and III

Ans:-B Explanation:Recursive languages are closed under the following operations.


1. 2. 3. 4. 5. 6. Kleene star Concatenation Union Intersection Complement Set difference

Recursively enumerable languages are closed under the following operations. 1. 2. 3. 4. Kleene star Concatenation Union Intersection

Recursively enumerable languages are not closed under complement. So the statements I and II are only true. So the option is B.

41. What is the routing algorithm used by RIP and IGRP ? (A) OSPF (B) Link-state (C) Dynamic (D) Dijkestra vector

Ans:23

Explanation:- Actually in the answer key it is given as D which is Dijkestra vector. RIP(Routing Information Protocol) and IGRP(Interior Gateway Routing Protocol) are examples of Distance Vector routing protocols and Open Shortest Path First(OSPF) is an example of Link State routing protocols. Distance Vector routing protocols are based on Bellma and Ford algorithms. Link state routing protocols are based on Dijkstra algorithms. Here the options OSPF, Link-state are ruled out. Even Dijkestra is ruled out because link state protocols are based on that. The only left out option is C which is Dynamic and which does not comply with the answer key. So i am just not entering any particular option for it.

42. Identify the incorrect statement : (A) The overall strategy drives the E-Commerce data warehousing strategy. (B) Data warehousing in an E-Commerce environment should be done in a classical manner. (C) E-Commerce opens up an entirely new world of web server. (D) E-Commerce security threats can be grouped into three major categories.

Ans:-D Explanation:- E-commerce security threats are more than 3 in number and so the incorrect statement here is D.

43. Reliability of software is directly dependent on (A) quality of the design (B) number of errors present (C) software engineers experience (D) user requirement

Ans:-B Explanation:- One of the closest answer to this also could be option A which is quality of the design. But it can also be understood that if a software product has a large number of defects it is unreliable. So if the reliability of the software improves it means that the number of defects has reduced. So reliability of software is dependent on the number of errors present. So it is option B.

44. ______ is not an E-Commerce application. (A) House banking (B) Buying stocks 24

(C) Conducting an auction (D) Evaluating an employee

Ans:-D Explanation:- This is a simple one and in fact does not need any explanation.

45. ______ is a satellite based tracking system that enables the determination of persons position. (A) Bluetooth (B) WAP (C) Short Message Service (D) Global Positioning System

Ans:-D Explanation:- Again quite a easy one and does not need much explanation.

46. A complete microcomputer system consists of (A) Microprocessor (B) Memory (C) Peripheral equipment (D) All of the above

Ans:-D Explanation:- Again no explanation needed!!!.

47. Where does a computer add and compare data ? (A) Hard disk (B) Floppy disk (C) CPU chip (D) Memory chip

Ans:-C

25

Explanation:- Since option A,B and D are ruled out, the answer is option C.

48. Pipelining strategy is called implement (A) instruction execution (B) instruction prefetch (C) instruction decoding (D) instruction manipulation

Ans:-B Explanation:- Pipelining is a technique to build fast processors. It allows the execution of multiple instruction by overlapping them. In an assembly unit every stage has one and only one activity to do. It keeps repeating them again and again. In the same way in a instruction pipeline at every clock cycle one particular step of multiple instruction will be performed. Every instruction has multiple stages. Say at the first clock cycle first step of instruction1 is performed. At the second clock cycle the second step of instruction1 and 1st step of instruction2 would be performed and so on. So pipelining is called instruction prefetch. So the option is B.

49. Which of the following data structure is linear type ? (A) Strings (B) Lists (C) Queues (D) All of the above

Ans:-D No explanation needed

50. To represent hierarchical relationship between elements, which data structure is suitable ? (A) Dequeue (B) Priority (C) Tree (D) All of the above

Ans:-C
26

Explanation:- Dequeue and priority are types of queues which is again a linear data structure. If you want to represent hierarchal elements we should go for tree and so answer is option C.

JUNE 2012 - PAPER II


34. Check sum used along with each packet computes the sum of the data, where data is treated as a sequence of (A) Integer (B) Character (C) Real numbers (D) Bits

Ans:-B Explanation:- Check sum is the error detecting mechanism when data is treated as a sequence of character. Parity is the mechanism used when data is treated as a sequence of bits.

35. If an integer needs two bytes of storage, then the maximum value of a signed integer is (A) 216 1 (B) 215 1 (C) 216 (D) 215

Ans:-B

36.Which of the following logic families is well suited for high-speed operations ? (A) TTL (B) ECL (C) MOS (D) CMOS

Ans:-B Explanation:- ECL stands for Emitter-Coupled Logic. It is designed for extremely high speed application. It is well suited for large mainframe computer that require high number of operation per second.

Posted by Vani Chakraborty at 05:11 No comments: 27

Email ThisBlogThis!Share to TwitterShare to Facebook

Friday, 14 September 2012

JUNE 2012 - PAPER II


30. In round robin CPU scheduling as time quantum is increased the average turn around time (A) increases (B) decreases (C) remains constant (D) varies irregularly

Ans:-D Explanation:There are few criterias used for measuring the performance of a particular scheduling algorithm. The turn around time is the interval of time between the submission of a process and its completion. The wait time is the amount of time a process has been waiting in the ready queue. The response time is the time taken between the process submission and the first response produced. In RR algorithm, the value of time quantum or the time slice, plays a crucial role in deciding how effective the algorithm is. If the time quantum is too small, there could be lot of context switching happening which could slow down the performance. If the time quantum is too high, then RR behaves like FCFS. If the time quantum is increased, the average response time varies irregularly. If you take any comprehensive material on operating system, you will come across a graph which depicts this behavior. So the answer is option D.

31. Resources are allocated to the process on non-sharable basis is (A) mutual exclusion (B) hold and wait (C) no pre-emption (D) circular wait

Ans:-A Explanation:- There are four necessary and sufficient conditions for a deadlock. One of them is Mutual Exclusion which means that the resources involved are non-sharable. So the answer is option A.

28

32. Cached and interleaved memories are ways of speeding up memory access between CPUs and slower RAM. Which memory models are best suited (i.e. improves the performance most) for which programs ? (i) Cached memory is best suited for small loops. (ii) Interleaved memory is best suited for small loops (iii) Interleaved memory is best suited for large sequential code. (iv) Cached memory is best suited for large sequential code. (A) (i) and (ii) are true. (B) (i) and (iii) are true. (C) (iv) and (ii) are true. (D) (iv) and (iii) are true.

Ans:-B Explanation:- Compared to the processor speed, the speed of the primary memory is slow. Cache memory is a small memory which sits in between the processor and primary memory and fetches information to the processor at a much higher speed or it makes it appear so. Caching can be effective based on a property of computer programs called locality of reference. Analysis of program show that the majority of the execution time is spent around a small part of the program may be a simple loop,nested loop or a few functions. The rest of the program is accessed infrequently. There is something called temporal locality and spatial locality also which we need to know when we talk about cache. But cache memory is ideally suited for small loops. Interleaved memory is a technique for increasing the speed of RAM. Here multiple memory chips are grouped together to form what are known as banks.Each of them take turns for supplying data. An interleaved memory with "n" banks is said to be n-way interleaved. Macintosh systems are considered to be one using memory interleaving. So the answer for this question is option B.

33. Consider the following page trace : 4,3, 2, 1, 4, 3, 5, 4, 3, 2, 1, 5 Percentage of page fault that would occur if FIFO page replacement algorithm is used with number of frames for the JOB m = 4 will be (A) 8 (B) 9 (C) 10 (D) 12

Ans:-C Explanation:The reference string is 4,3,2,1,4,3,5,4,3,2,1,5 The number of frames m = 4


29

The first 4 references(4,3,2,1) cause page faults and brought into the empty frames. The next reference (4) is already available and so there is no page fault. The next reference (3) is also already available and so there is no page fault. The next reference (5) replaces page 4 which was brought in first.No of page faults=5. Next reference (4) replaces page 3 which is the next to come in.No of page faults=6. Next reference (3) replaces 2.No of page faults till now=7. Next reference (2) replaces 1 which was the last of the pages to come in. No of page faults till now=8. Next reference (1) replaces 5 which was the first to come in in the second cycle. No of page faults till now=9. The last reference in the reference string is 5 which will replace 4. No of page faults till now=10 So the answer is option C which is 10.

Posted by Vani Chakraborty at 06:14 2 comments: Email ThisBlogThis!Share to TwitterShare to Facebook

Thursday, 13 September 2012

JUNE 2012 - PAPER II


24. In a function oriented design, we (A) minimize cohesion and maximize coupling (B) maximize cohesion and minimize coupling (C) maximize cohesion and maximize coupling (D) minimize cohesion and minimize coupling

Ans:-B Explanation:A function oriented design focusses on creating modules or functions and each module supports its own abstraction. The design purpose is to minimize coupling and maximize cohesion. Cohesion is a way of understanding how close or bound your module is. Coupling is the level of interactivity between modules. For a good design to happen cohesion should be more and coupling should be less.

25. Which of the following metric does not depend on the programming language used ? (A) Line of code (B) Function count 30

(C) Member of token (D) All of the above

Ans:-B Explanation:Line of count and Member of token depend on the programming language. Function count does not depend on programming language. Function count are a unit of measure for software just like a unit of measure for temperature would be degrees.

26. A/B+ tree index is to be built on the name attribute of the relation STUDENT. Assume that all students names are of length 8 bytes, disk block are of size 512 bytes and index pointers are of size 4 bytes. Given this scenario what would be the best choice of the degree (i.e. the number of pointers per node) of the B+ tree ? (A) 16 (B) 42 (C) 43 (D) 44

Ans:-C Actually the answer given in the UGC answer key is option A. But i would beg to differ with that. Using the formula for calculating the degree with the parameters specified above, the answer we are arriving at is 43 which is actually option C. Let me explain how it is done. Let n be the degree. Given, Key size(length of the name attribute of STUDENT) = 8 bytes(k) Index pointer size = 4 bytes (b) Disk Block size = 512 bytes Degree of B+ tree can be calculated if we know the maximum number of key a internal node can have. The formula for that is (n-1)k+n*b= blocksize (n-1)*8+n*4=512 8n - 8 + 4n = 512 12n=520 n=520/12=43
So, the answer is option C.

31

27. The Inorder traversal of the tree will yield a sorted listing of elements of tree in (A) Binary tree (B) Binary search tree (C) Heaps (D) None of the above

Ans:-B Explanation:In a binary search tree all the elements to the root of the tree will lesser than that of the root. Also elements greater than the root will be to the right of the root. So, in order traversal of such a tree would yield a sorted listing of elements.

28. Mobile IP provides two basic functions. (A) Route discovery and registration (B) Agent discovery and registration (C) IP binding and registration (D) None of the above

Ans:-B Explanation:Mobile IP is the basic behind how wireless devices offer IP connectivity. Agent discovery and registration are two basic functions involved here. So the options is B.

29. Pre-emptive scheduling is the strategy of temporarily suspending a gunning process (A) before the CPU time slice expires (B) to allow starving processes to run (C) when it requests I/O (D) to avoid collision

Ans:-A Explanation:Again one of those rare non ambiguous question. Every process is allocated a specific time slice in the CPU and it runs for that entire time. In pre-emptive scheduling even before the process's time slice expires, it is temporarily suspended from its execution. So the option is A.
32

Posted by Vani Chakraborty at 05:16 1 comment: Email ThisBlogThis!Share to TwitterShare to Facebook

Wednesday, 12 September 2012

JUNE 2012 - PAPER II


19. The station to hub distance in which it is 2000 metres. (A) 100 Base-Tx (B) 100 Base-Fx (C) 100 Base-T4 (D) 100 Base-T1

Ans:-B Explanation:- Traditional Ethernet technologies had four standards for 10Mbps. They are,
1. 2. 3. 4. 10BaseT - 100 meters 10Base2 - 185 meters 10Base5 - 500 meters 10BaseFL - 2000 meters

Fast Ethernet is referred by 100BaseX standard. 100BaseX has three specifications. Here 100 refers to the speed 100Mbps. Base refers to Baseband.The specifications are 1. 100BaseT4 2. 100BaseTX 3. 100BaseFX 100BaseFx uses the 2-strand fiber-optic cable and the station to hub distance is 2000 metros.

20.Main aim of software engineering is to produce (A) program (B) software (C) within budget (D) software within budget in the given schedule

33

Ans:-D Explanation:- Not much explanation needed here.

21. Key process areas of CMM level 4 are also classified by a process which is (A) CMM level 2 (B) CMM level 3 (C) CMM level 5 (D) All of the above

Ans:-C Explanation:- In CMM model there are five maturity levels identified by the numbers 1 to 5. They are
1. 2. 3. 4. 5. Initial Managed Defined Quantitatively Managed Optimizing

If an organization is at level 2, it means it has crossed over level 1 and the same holds true for subsequent levels. At level 4, the process at level 3 is also included. CMM level 5 is not correct because the question only talks about level 4. CMM level 2 is not correct because level 3 includes level 2 as well. So option C is the correct answer.

22. Validation means (A) are we building the product right (B) are we building the right product (C) verification of fields (D) None of the above

Ans:-B Explanation:Validation - Are we building the right product Verification - Are we building the product right.

34

23. If a process is under statistical control, then it is (A) Maintainable (B) Measurable (C) Predictable (D) Verifiable

Ans:-C Explanation:The answer is available in the book "Integrated approach to software engineering" by Pankaj Jalote. A predictable process is also said to be under statistical control.

Posted by Vani Chakraborty at 09:48 No comments: Email ThisBlogThis!Share to TwitterShare to Facebook

JUNE 2012 - PAPER II


14. Which of the following TCP/IP Internet protocol is diskless machine uses to obtain its IP address from a server ? (A) RAP (B) RIP (C) ARP (D) X.25

Ans:-C Explanation:- ARP is a protocol in the TCP/IP protocol suite. This protocol is required for basic TCP/IP operations. This protocol is used to find the ethernet(hardware) address from a specific IP number.

15. Decryption and encryption of data are the responsibility of which of the following layer ? (A) Physical layer (B) Data Link layer (C) Presentation layer (D) Session layer

35

Ans:-C Explanation:- Not a very complicated question. Decryption and encryption of data happens in the presentation layer. One more important activity which happens at this layer is the Compression and decompression of data.

16. In which circuit switching, delivery of data is delayed because data must be stored and retrieved from RAM ? (A) Space division (B) Time division (C) Virtual (D) Packet

Ans:-B

17. In which Routing Method do all the routers have a common database ? (A) Distance vector (B) Link state (C) Link vector (D) Dijkestra method

Ans:-B Explanation:- There are two major classes of routing methods.One is Distance vector and the other one Link state. In distance vector, each router knows only its neighbors. Decision is taken on two factors one is distance and the other vector, that is the direction to reach. In case of link state all the routers know about the paths reachable by all other routers in the network. All routers possess a synchronized copy of the area's link-state database. So the answer for this question would be option B.

18. Page Shift Keying (PSK) Method is used to modulate digital signal at 9600 bps using 16 level. Find the line signals and speed (i.e. modulation rate). (A) 2400 bauds (B) 1200 bauds ( C) 4800 bauds (D) 9600 bauds 36

Ans:-A Explanation:- Inorder to know why option A is the answer, let us understand the following table.
MODULATION BAUD RATE BIT RATE 4-PSK 8-PSK 16-PSK N N N 2N 3N 4N

In the question it is mentioned as page shift keying, but it is actually Phase Shift Keying. Two values are provided. One is bps which is nothing but Bits per second which is 9600 and also level which is 16. According to the table given above, for a 16-PSK, given the baud rate N, the bit rate would be 4N. Here bps is provides which is 9600. In order to calculate the baud rate we have to divide bps/4, because the signal level is 16. So the answer would be 9600/4=2400 baud. That is how the answer is arrived at. Posted by Vani Chakraborty at 06:24 2 comments: Email ThisBlogThis!Share to TwitterShare to Facebook

Tuesday, 11 September 2012

JUNE 2012 - PAPER II


10. Which command is the fastest among the following ? (A) COPY TO (B) COPY STRUCTURE TO (C) COPY FILE (D) COPY TO MFILE-DA T DELIMITED

Ans:-B Explanation:- I am considering the same answer as what is given in the UGC answer key. I will find out why that command is supposedly faster than the rest. Give me some time. Meanwhile, i do not want to get stuck in this question and i want to proceed. So we are off to the next one but will visit the same sometime later.

37

11. B+ tree are preferred to binary tree in Database because (A) Disk capacity are greater than memory capacities (B) Disk access is much slower than memory access (C) Disk data transfer rates are much less than memory data transfer rate (D) Disks are more reliable than memory

Ans:-B Explanation:- Actually the same question was given in GATE CS(2000) paper and the solution is available in a webpage called geeksforgeeks. A good page with solutions to some gate questions. Everyone knows that disk access is slower compared to memory access. When we compare a binary tree to a B+ tree, B+ tree is supposed to have a higher fanout. What is a fanout actually?. B+ trees can store a relatively large number of pointers to child nodes in each node. Fanout means the number of pointers per node. B+ trees minimize the depth of the tree( and so one can reach the leaf node faster)by employing high fanout. That is linking many children from each node. Because of a high fanout the number of I/O operations required to find an element in the tree would be less. So B+ trees are preferred. The option is B.

12. A Transaction Manager is which of the following ? (A) Maintains a log of transactions (B) Maintains before and after database images (C) Maintains appropriate concurrency control (D) All of the above

Ans:-D Explanation:- Transaction manager performs all the operations mentioned in option A,B and C.

13. Leaves of which of the following trees are at the same level ? (A) Binary tree (B) B-tree (C) A VL-tree (D) Expression tree

Ans:-B Explanation:- In a B-tree leaves are at the same level. A B-tree of order m is an m-way tree which means that for each node there may be upto m children. m should be odd only.
38

Posted by Vani Chakraborty at 12:18 No comments: Email ThisBlogThis!Share to TwitterShare to Facebook

JUNE 2012 - PAPER II


4. The number of colours required to properly colour the vertices of every planer graph is (A) 2 (B) 3 (C) 4 (D) 5

Ans:-D Explanation:- According to the Five-colour theorem, Every planar graph is 5-colourable. Any planar graph G with n vertices requires five colors for proper coloring. So the answer must be option D which is 5. But in the UGC answer key it is given as 2, option A. But the correct answer is D.

5. Networks that use different technologies can be connected by using (A) Packets (B) Switches (C) Bridges (D) Routers

Ans:-D Explanation:- Packets are the units of exchanging information in network. A bridge connects two or more networks, or segments of the same network. Switches are basically Bridges but usually have multiple ports. Routers forward data packets from one place to another. They forward data depending on the network, not the hardware(MAC)address. So the answer is option D.
6.Both hosts and routers are TCP/IP protocol software. However, routers do not use protocol from all layers. The layer for which protocol software is not needed by a router is (A) Layer 5 (Application) (B) Layer 1 (Physical)

39

(C) Layer 3 (Internet) (D) Layer 2 (Network Interface)

Ans:-A Explanation:- Routing is a way to get one packet from one destination to the next. But the Layer - 5 (Application) includes all the higher-level protocols. So the layer for which protocol software is not needed by a router is Layer - 5, the Application Layer which is option A.

7. In multiuser database if two users wish to update the same record at the same time, they are prevented from doing so by (A) Jamming (B) Password (C) Documentation (D) Record lock

Ans:-D Explanation:- The explanation is quite simple. It is a straightforward question with less confusing options. So if we are talking about a multiuser database and if two users wish to update the same record at the same time, they are prevented from doing so by using Record lock.

8. A binary search tree is a binary tree : (A) All items in the left subtree are less than root (B) All items in the right subtree are greater than or equal to the root (C) Each subtree is itself a binary search tree (D) All of the above

Ans:-D Explanation:- The statements given in the option A and C are true, is very clear. There could be only a slight confusion whether statement in option B is true or not. The above mentioned properties are mentioned in the book on Data structures:A pseudocode approach with C written by Richard F.Gilberg et al. According to the summary on binary search trees the following properties are mentioned.

All items in the left subtree are less than the root. All items in the right subtree are greater than or equal to the root. Each subtree is itself a binary search tree. 40

So the correct answer for this question would be option D.

9. What deletes the entire file except the file structure ? (A) ERASE (B) DELETE (C) ZAP (D) PACK

Ans:-C

June 2012 - Paper II


Hey everyone, back after a two day break. Since we are done with December 2010 paper, I want to choose the next one and it would be June 2012 now. From June 2012, Paper-II and Paper-III are objective so we will do with paper-II first and then get on to paper-III. Like all other solutions, it is all about understanding the answer and arriving at it conclusively, so that we can learn something out of it which can be used in another situation. It is never about simply remembering the answer for every question. It is all about understanding it. That is why i am spending some time going through the explanation for answering every question. Infact i wanted to do only one question a day, but that way we would take a lot of time in finishing the solutions for the question papers and so i try to answer more than one question. Okay, without wasting much of time, let us start. 1. The postfix expression AB + CD * can be evaluated using a (A) stack (B) tree (C) queue (D) linked list Ans:-A Explanation:-This is a simple question. The postfix expression can be evaluated using a stack. First the operands are pushed into the stack and the moment a operator is encountered, operands are popped out, operation performed on the operands and the result once again pushed into the stack. This series of activities continue till the entire expression is not evaluated. So the answer is A.

2. The post order traversal of a binary tree is DEBFCA. Find out the pre- order traversal. (A) ABFCDE (B) ADBFEC 41

(C) ABDECF (D) None of the above

Ans:-C Explanation:A binary tree is a data structure which has at most two child nodes. A binary tree can be traversed in three ways. Inorder, preorder and postorder. The three methods of traversal can be explained this way.
TYPE Inorder FIRST L - Left SECOND THIRD

Ro - Root R - Right R - Right

Preorder Ro - Root L - Left Postorder L - Left

R - Right Ro - Root

Left will always be followed by right. But Root would be either in the front or in the middle or at the last depending on whether it is pre, in or postorder traversal. So given a post order traversal of a binary tree, we can know the root first. In the question, the post order traversal is given as DEBFCA. Since Root is the last node to be traversed in a post order traversal we know one thing for sure. A is the root. Next, we are left with only DEBFC. Here some of the nodes belong to the left side of the binary tree and some belong to the right side. How many nodes belong to the left and how many belong to the right. Since left side of the binary tree is considered first, and since every node is expected to have at most two child, DEB will be the left side of the binary tree and FC would be the right. Now, we know that FC is in the right side of the binary tree. Again the last node would be the root of the sub tree and F its left side. Next we come to the left side of the binary tree and it is DEB. Again B would be the root of the sub tree. D and E are its left and right side respectively. So the binary tree would look something like this given below.

42

After constructing the binary tree, writing the preorder traversal is very simple. In preorder traversal root comes first. Since A is the root, A would appear first. Following Root would be the Left and Right sub tree and so the left subtree would be BDE. Again B would be the root of the left sub tree followed by D and E which are the left and right child respectively. SO the preorder traversal till now would be ABDE. Last comes the Right sub tree. Here again C would be the root of the right sub tree followed by C its left child. So the entire preorder traversal of the tree would be ABDECF. So option C is the right answer.

3.The branch logic that provides making capabilities in the control unit is known as (A) Controlled transfer (B) Conditional transfer (C) Unconditional transfer (D) None of the above

Ans:-A Explanation:- This question is available in lot of websites and other materials and the answer given there is unconditional transfer which is option C. But UGC answer key is given as option
43

A. I am just going to go with A, but will find out more about this and post it. Meanwhile, if there are any explanation for this question,please post it, so that everyone can benefit.

Posted by Vani Chakraborty at 05:15 2 comments: Email ThisBlogThis!Share to TwitterShare to Facebook

Friday, 7 September 2012

December 2010 - Question No 36 - 50


36. The dynamic allocation of storage areas with VSAM files is accomplished by (A) Hashing (B) Control splits (C) Overflow areas (D) Relative recoding

Ans:-B Explanation:-VSAM stands for Virtual Storage Access Method. It was introduced by IBM. It is a method of managing files. It can speed up the access to data in the files. The dynamic allocation of storage areas with VSAM files is accomplished by Control Splits.

37. Which of the following command the file names in multiple columns ? (A) ISX (B) IS (C) IS 1 (D) ISfX

Ans:-B Explanation:- Although the command appears to look like IS, it should be understood as ls. There is no command called IS anywhere i could think of. ls with a -1 option will list only one entry per line. So option C is ruled out. The purpose of -X option is to sort out the list alphabetically by entry extension. The purpose of -f option is not to sort the list alphabetically. This option also puts on the -a option. So all the files including hidden ones will be displayed. So what is the option which would list columnar listing of names.It is actually -C. But the output of ls -C and ls simply matches and so i have chosen option B as the right answer which is ls itself. If anyone has any other answer or explanation please post it and we can discuss it.
44

38. WINDOWS is a _________ operating. (A) Real time (B) Multi-user (C) Preemptive (D) Non-preemptive

Explanation:- I would straightaway go for the explanation here. The question is a typical UGC Net one intended to confuse the candidates. WINDOWS is specified, no specific version or anything is given. If you consider windows 3.x, it was cooperative and non-preemptive. But windows 95,NT and 2000 are preemptive. Windows 3.x was not multi-user. But windows NT,2000 are multi-user. Again windows 3.x cannot be categorized as a real time operating system also. Since the question itself has got some ambiguity you can choose whatever option which you feel and keep your fingers crossed about it. I would not go with Real time. Anything else i could go with. Please post any other way of understanding this question and the correct answer for this. Till then, i refrain from answering this question.

39. Page making process from main memory to disk is called (A) Interruption (B) Termination (C) Swapping (D) None of the above

Ans:-C Explanation:- Swapping is one of the memory management techniques used by the operating system. Since the size of the RAM is limited and finite, all the processes or programs to be executed cannot be made to fit in it. So the disk is also treated as an extension of the memory and is referred to as virtual memory. The page making process from main memory to disk is called swapping.

40.A Dead-lock in an Operating System is (A) Desirable process (B) Undesirable process (C) Definite waiting process (D) All of the above

45

Ans:-B Explanation:- Deadlocks are undesirable. In a deadlock situation, processes never finish executing and system resources are tied up, preventing other jobs from ever starting. So the answer for this question is B.

41. Prototyping is used to (A) test the software as an end product (B) expand design details (C) refine and establish requirements gathering (D) None of the above

Ans:-C Explanation:- Prototyping is one of SDLC model. It starts with requirement gathering and establishing a quick prototype which is an early approximation of a final product. This prototype is then evaluated by the customer/user and used to refine the requirements for the software to be developed. So, C is the option.

42. Which one of these are not software maintenance activity ? (A) Error correction (B) Adaptation (C) Implementation of Enhancement (D) Establishing scope

Ans:-D Explanation:- Actually i have had my own doubts with the answer for this question. I have referred to lots of materials and paper and resolved the correct answer for this. According to Lientz and Swanson, software maintenance can be divided into three components. corrective, adaptive and perfective maintenance. Corrective maintenance involves correcting errors or actual faults in the software. So this is option A. Adaptive maintenance is the changes needed as a consequence of some change in the environment in which the system must operate. And this is option B. Finally perfective maintenance refers to changes that originate from user requests. Infact adaptive and perfective categories can be joined together and called as enhancements which is option C. So the only one which is not talked about is option D and so D is the right answer.

46

43. The system specification is the first deliverable in the computer system engineering process which does not include (A) Functional Description (B) Cost (C) Schedule (D) Technical Analysis

Ans:-A Explanation:- The system specification document describes the system and gives a high-level view of what the system will provide. The system specification is the guide that will allow details on hardware,software and test requirements. So i think functional description will not be a part of system specification. So the correct answer is A.

44. The COCOMO model was introduced in the book title Software Engineering Economics authored by (A) Abraham Silberschatz (B) Barry Boehm (C) C.J. Date (D) D.E. Knuth

Ans:-B Explanation:- This is a fairly simple question. COCOMO model was introduced in the book authored by Barry Boehm. So the correct answer is B.

45. The Warnier diagram enables analyst (A) to represent information hierarchy in a compact manner (B) to further identify requirement (C) to estimate the total cost involved (D) None of the above

Ans:-A Explanation:- The Warnier diagram enables analyst to represent information hierarchy in a compact manner. It is also referred to as Warnier-Orr diagram. It is a graphic charting technique used in software engineering for system analysis and design.
47

46. A data mart may contain (A) summarised data (B) de-normalized data (C) aggregate departmental data (D) All of the above

Ans:-D Explanation:- Datawarehouses are huge. If a department has its own data mart, it can customize the data as the data flows into the data mart from the data warehouse. It can summarize,sort,select and structure its own data.So the option would be D.

47. Data mining is (A) the process of extracting valid, previously unknown, comprehensible and actionable information from large databases and using it to make crucial business decisions. (B) a tool that allows end users direct access and manipulation of data from within data- warehousing environment without the intervention of customised programming activity. (C )a tool that helps end users extract useful business information from large database. (D)All of the above

Ans:-A Explanation:- Since it is a definition of Data Mining which is spoken about, option A is correct.

48. E-Choupal refers to (A) calling meeting of Surpanches electronically. (B) conducting Panchayat meeting using latest electronic gadgets. (C) providing window of information to villagers and farmers in NIC network. (D) None of the above

Ans:-C Explanation:- E-Choupal is an initiative by ITC. Through this initiative they want to empower the farmers with expert knowledge. This would enhance his competitiveness in the global market.
48

49. The basic concepts of ethics in information society is/are (A) Responsibility (B) Accountability (C) Liability (D) All of the above

Ans:-D Explanation:- Nothing much. The basic concepts of ethics in information society is/are Responsibilty,Accountability and Liability. I think most of you would have guessed it anyway.

50. One of the distinguished features of super-computer over other category of computer is (A) parallel processing (B) highest accuracy level (C) more speed (D) more capacity

Ans:-A Explanation:- Option B is ruled out. But all the other options also look similar but since they are asking about distinguished feature i would go with option A. Any other ideas please post.

Whewwe are done with December 2010 QP. Wait and watch for the next paper and discussion of its solutions. Posted by Vani Chakraborty at 05:37 No comments: Email ThisBlogThis!Share to TwitterShare to Facebook

Thursday, 6 September 2012

December 2010 - Question 31-35

49

31. Object code is the output of ______. (A) Operating System (B) Compiler or Assembler (C) only Assembler (D) only Compiler

Ans:-B Explanation:- Again this is one of those questions where more than one option looks correct. I think option B is correct because both compiler and assembler converts the source language code to the object code. If anyone has any other version,please post it and we can discuss it.

32. 'Macro' in an assembly level program is _______. (A) sub program (B) a complete program (C) a hardware portion (D) relative coding

Ans:-A Explanation:-Looking at all the other options, the only one which seems more appropriate is option A.

33. Grammar of the programming is checked at ________ phase of compiler. (A) semantic analysis (B) code generation (C) syntax analysis (D) code optimization

Ans:-C Explanation:- The following are the main phases of a compiler and the activities done in each one of the phases. 1.Lexical Analysis:-In this phase the source program is split into what are called 'tokens'. 2.Syntax Analysis:-The tokens are grouped together into phrases which should match some specified grammar.Normally, one of the outputs of a syntax analysis phase would be a Abstract Syntax Tree.(AST) 3.Semantic Analysis:-This phase would traverse through the AST and refine it.
50

4.Intermediate code generation:-This phase generates a machine independent code. 5.Code optimization:-Use some strategies to optimize the code that is generated. 6.Code generation:-Generate the machine dependent code finally. Symbol table generation and error handling would be part of almost all phases. So the grammar checking would be done at syntax analysis phase. Hence the option is C.

34. The register or main memory location which contains the effective address of the operand is known as (A) pointer (B) special location (C) indexed register (D) None of the above

Ans:-A

35. Macro-processors are ______. (A) Hardware (B) Compiler (C) Registers (D) None of the above

Ans:-B

Posted by Vani Chakraborty at 05:29 No comments: Email ThisBlogThis!Share to TwitterShare to Facebook

December 2010 - Question No 26,27,28,29,30


26. Frequency shift keying is used mostly in (A) Radio transmission (B) Telegraphy (C) Telephone (D) None of the above

51

Ans:-B Explanation:- Frequency shift keying is a method of transmitting digital signals.FSK was mostly used in telegraphy. The two binary states 0 and 1 are represented by a specific analog waveform in FSK. Nowadays, a modem converts the binary data into FSK for transmitting across telephone lines and does the reverse at the receiving end. There is one more method of transmitting digitals signals where the phase of a transmitted signal is varied to convey information. This is called Phase Shift Keying(PSK).

27. The baud rate is (A) always equal to the bit transfer rate (B) equal to twice the bandwidth of an ideal channel (C) not equal to the signalling rate (D) equal to half of the bandwidth of an ideal channel

Ans:-B Explanation:The baud rate of a data communication system is the number of symbols per second transferred. It is equal to twice the bandwidth of an ideal channel.

28.How much bandwidth is there in 1 micron of spectrum at a wavelength of 1 micron ? (A) 300 MHz (B) 3 GHz (C) 300 THz (D) 30 KHz

Ans:-D

29. Which of the following file transfer protocols use TCP and establishes two virtual circuits between the local and remote server ? (A) FTP (B) TFTP (C) TELNET (D) NFS 52

Ans:-A Explanation:- There could be a ambiguity between the options A and B for this one. C and D are ruled out. So, what is the difference between FTP and TFTP. The purpose of both the protocols is to obtain files from a remote host. But TFTP stands for trivial file transfer protocol. It is not very reliable or secure. It uses the packet delivery service offered by UDP. On the other hand, FTP stands for File Transfer Protocol. It is a mechanism provided by TCP/IP. It uses the services offered by TCP. It is reliable and secure. It establishes two connections(virtual circuits)between the hosts, one for data transfer and another for control information. So the answer for this question is option A.

30. The threshold effect in demodulator is (A) exhibited by all demodulator, when the input signal to noise ratio is low. (B) the rapid fall on output signal to noise ratio when the input signal to noise ratio fall below a particular value. (C) the property exhibited by all A.M. suppressed carrier coherent demodulator. (D) the property exhibited by correlation receiver.

Ans:-B

Posted by Vani Chakraborty at 04:05 No comments: Email ThisBlogThis!Share to TwitterShare to Facebook

Wednesday, 5 September 2012

December 2010 - Question No 24 & 25


24. Linear probing suffers from a problem known as (A) Secondary clustering (B) Primary clustering (C) Both (A) and (B) (D) None of these

Ans:-B Explanation:- Linear probing is a term associated with hashing. Linear probing is a collision resolving technique in hashing. It suffers from a problem known as primary clustering. Any chosen hash function should uniformly distribute the records across the given available address
53

space but sometimes clusters appear. If linear probing is used, it might spend a lot of time probing within the cluster instead of searching in the subsequent available space. One more collision resolving technique is Quadratic probing. Again we might come across the same topic depending on the nature of question encountered in future.

25. Which of the following can be the sequence of nodes examined in binary search tree while searching for key 88 ? (A) 90, 40, 65, 50, 88 (B) 90, 110, 80, 85, 88 (C) 190, 60, 90, 85, 88 (D) 65, 140, 80, 70, 88

Ans:-C Explanation:- Inorder to find a solution for a question like above, given the data draw a binary search tree for each one of the options. The first item is the root. Any value less than the root will form the left side of the tree and any value greater than the root will form the right side of the tree. When you draw such a tree, if you find no node has a left and right child then such a sequence would be valid. If you find that the tree has a left and right child for any node then that sequence is invalid. If you draw the tree for all the 4 options given in the question you will find that only option C does not have left and right child for any node. So option C is correct.
Posted by Vani Chakraborty at 05:50 No comments: Email ThisBlogThis!Share to TwitterShare to Facebook

December 2010 - Question No 21 & 22 & 23


21. What is the maximum number of nodes in a B-tree of order 10 of depth 3 (root at depth 0) ? (A) 111 (B) 999 (C) 9999 (D) None of the above

Ans:-C Explanation:The formula for calculating the maximum number of nodes in a B-tree of order order n of depth h is mh+1-1

54

Here, m=10 and h=3. So the formula becomes 104-1 which is 10000-1=9999 and therefore C is the correct option.

22. A binary tree with 27 nodes has _______ null branches. (A) 54 (B) 27 (C) 26 (D) None of the above Ans:-D

Explanation:This is quite a straightforward one. A binary tree with n nodes has n+1 null branches. So a binary tree with 27 nodes will have 28 null branches. Since 28 is not available as a option, D is the correct answer. There is some question based on binary trees or trees in most of the NET paper. The following question is from June 2011 paper and this is also based on trees. The number of different trees with 8 nodes is (A) 256 (B) 255 (C) 248 (D) None of these Ans:-C Explanation:The number of different trees with n nodes can be calculated as 2n-n. Here the value of n=8. So, the formula would become 28-8=256-8=248 So the answer is 248 and so the option is C.

23. The time complexity to build a heap of n elements is (A) 0(1) (B) 0(lgn) (C) 0(n) (D) 0(nlgn) 55

Ans:-C

Explanation:The WORST CASE COMPLEXITY to build a heap of n elements is the option C.


Posted by Vani Chakraborty at 04:47 2 comments: Email ThisBlogThis!Share to TwitterShare to Facebook

Tuesday, 4 September 2012

December 2010 - Question No 19 & 20


19. Optical storage is a (A) high-speed direct access storage device. (B) low-speed direct access storage device. (C) medium-speed direct access storage device. (D) high-speed sequential access storage device. Ans:-B Explanation:Actually the same question is available in the book "Database systems:Concepts, Design and application" by S.K.Singh. There are lot of questions at the end of every chapter in that book. According to the book, since the head assembly is heavier, DVD and CD drives have much longer seek time as compared to magnetic-disk drives. Rotational speeds of DVD and CD drives are lower than that of magnetic disk drives. So the answer for the above question is B which is optical storage is a low speed direct access storage device.

20. Which of the following is the process by which a users access to physical data in the application is limited, based on his privileges ? (A) Authorization (B) Authentication (C) Access Control (D) All of these Ans:-C 56

Explanation:-

In order to understand the answer for this we need to know the difference between authorization, authentication and access control. It is well explained in oracle docs. Authentication is the process by which a user's identity is checked. Authorization is the process by which the user's privileges are ascertained. Access control is the process by which the user's access to physical data in the application is limited, based on his privileges.

December 2010 - Question No 18


18. Which of the following is an optimistic concurrency control method ? (A) Validation based (B) Time stamp ordering (C) Lock-based (D) None of these Explanation:In order to know the answer for this let us first go through what concurrency control means. When many people try to make modifications to a database at any point of time, there should be a system of controls in place to ensure that changes made by one do not adversely affect the other. This is called concurrency control. THere are basically two major categories of concurrency control and types under them. Types of concurrency control 1. Pessimistic methods 1. Timestamp ordering methods 2. Serialization graph testing 3. Locking methods 2. Optimistic methods 1. Backward validation methods 2. Forward validation methods 3. Hybrid methods The main idea behind pessimistic method is that it is assumed that transaction could be problem prone. In optimistic method it is assumed that transaction may not face any problem. Optimistic methods are deadlock-free whereas pessimistic method is deadlock-prone. We can look at it in detail depending on any question which we will come across in future. In june 2011 paper -II we had the following question. The basic variants of time-stamp- based method of concurrency control are (A) Total time stamp-ordering (B) Partial time stamp ordering 57

(C) Multiversion Time stamp ordering (D) All of the above We will look at all such questions later. Ans:-A Posted by Vani Chakraborty at 04:27 1 comment: Email ThisBlogThis!Share to TwitterShare to Facebook

December 2010 - Question No 17


17. The dependency preservation decomposition is a property to decompose database schema D, in which each functional dependency X Y specified in F, (A) appeared directly in one of the relation schemas Ri in the decomposed D. (B) could be inferred from dependencies that appear in some Ri. (C) both (A) and (B) (D) None of these

Explanation:- The question itself requires a bit of explanation. It is not enough if you just know what is the right answer but you must also know why it is the right answer. The explanation would be a bit lengthy. Let us first dissect the question and explain some terms in terms of DBMS. Decomposition - This means replacing a relation with a collection of smaller relations. Relation - Relation is known as Table. Relation Schema - This is known as Table definition. Relation Schema for a "student" relation can be shown in the following way: Student(FirstName,LastName,DOB,Gender,Course,Regno,Address) Definition of Dependency preservation decomposition:Each FD specified in F either appears directly in one of the relations in the decomposition, or be inferred from FDs that appear in some relation. Let us consider an example for Dependency preservation Let R be a relation R(A B C D) Let there be 3 functional dependencies. FD1: A->B FD2: B->C FD3: C->D Let the relation R be decomposed into two more relations. R1(A B C) : R2(C D)
58

Let us first consider the relation R1(A B C). Here between A and B the functional dependency FD1 is preserved. Between B and C, FD2 is preserved. Let us now consider the second relation R2(C D). Between C and D the FD, FD3 is preserved. So in the two relations R1 and R2, all the 3 functional dependencies are preserved. Let us consider an example for Non-dependency preservation Let R be a relation R(A B C D) Let there be again 3 functional dependencies. FD1:A->B FD2:B->C FD3:C->D Let the relation be decomposed into two more relations> R1(A C D) R2(B C) Let us first consider the relation R1(A C D). There is no FD between A and C. There is a FD3 between C and D. Now let us consider the second relation R2(B C). There is FD2 between B and C. So, the two relations only support only FD's FD2 and FD3. FD1 is not supported. So these relations does not preserve dependency. Generally there are three desirable properties of a decomposition.
1. Lossless 2. Dependency preservation 3. Minimal redundancy The above question was based on dependency preservation decomposition. This example has been taken from the dependency preservation presentation by Jason Allen. The explanation is quite good there. SUMMARY:The dependency preservation decomposition is a property to be considered for decomposing a relation into two or more smaller relations. The functional dependency X->Y specified in F can appear directly in one of the relation schemas Ri in the decomposed D or it could be inferred from dependencies that appear in some Ri. So the answer for this question is C. Ans:-C Posted by Vani Chakraborty at 03:22 No comments: Email ThisBlogThis!Share to TwitterShare to Facebook

Monday, 3 September 2012

December 2010 - Question 15 & 16

59

15. "Black refers in the Black-box testing means (A) Characters of the movie Black (B) IO is hidden (C) Design is hidden (D) Users are hidden

Explanation:For obvious reasons, option A is ruled out. Now let us look at the meaning of black box testing. The term "Black box" refers to the actual software that is getting tested. In black box testing one knows only the set of inputs and expected outputs and is unaware of how those inputs are transformed into outputs by the software. So option C seems to be the right choice. There are many types of black box testing techniques. It is better to know some of them by name.
1. 2. 3. 4. Boundary Value Analysis(BVA) Equivalence Class Testing Decision Table based testing Cause-Effect Graphing Technique

Depending on any more questions based on black box testing we can go through the techniques in detail later. I think knowing some technique names could be useful for now. Ans:-C

16. In generalisation, the differences between members of an entity is (A) maximized (B) minimized (C) both (A) & (B) (D) None of these Ans:-B Explanation:Generalisation and specialization are two terms that have a opposite meaning. In generalization the differences between members of an entity is minimized. Generalisation is a bottom up process. It goes from more specific to more general. For example, if the subclasses are taken as car and bike they would fall under the category of superclass called vehicle. From the subclasses we would identify features which can take us to the superclass vehicle.

60

Specialisation is the opposite of this. In Specialisation the differences between members of an entity are maximized. Specialisation is a top down process. It goes from more general to more specific. If vehicle is a super class and car and bike are its subclasses, identifying the characteristics or uniqueness of its subclasses is what happens in specialization. It is a sort of repeatedly asked question. In June 2010 the following question appeared. Generalization is _______ process. (A) top-down (B) bottom up (C) both (A) & (B) (D) None of these The answer of course is B, Generalisation is a bottom up process. To summarise, Generalisation - Bottom up - Differences between members of an entity is minimized. Specialisation - Top down - Differences between members of an entity is maximized. This could be a very important question. Please go through it again if need be.
Posted by Vani Chakraborty at 03:44 No comments: Email ThisBlogThis!Share to TwitterShare to Facebook

Sunday, 2 September 2012

December 2010 - Question No 14


Which one of the following sentences is true ? (A) The body of a while loop is executed at least once. (B) The body of a do ... while loop is executed at least once. (C) The body of a do ... while loop is executed zero or more times. (D) A for loop can never be used in place of a while loop. Ans:-B Explanation:- Since this question is a very simple and easy one i am posting the answer for this also today. Otherwise my idea was to take one question, explore it, analyze and then try to present the answer. Although many of the readers must be knowing this answer i still want to emphasize that the body of a dowhile loop is executed at least once, since the condition is tested at the bottom. In case of while loop and for loop, the condition is tested at the top of the loop, so there are chances that they may not be executed at all. But that is not the case with the dowhile loop. A dowhile loop will be executed at least once.
Posted by Vani Chakraborty at 12:57 No comments: 61

Email ThisBlogThis!Share to TwitterShare to Facebook

December 2010 - Question No 13


Which one of the following will set the value of y to 5 if x has the value 3, but not otherwise ?

(A) if (x=3)y=5 (B) if x==3(y=5) (C) if (x==3);y=5 (D) if (x==3)y=5 ANS:-D EXPLANATION:It is always tricky to answer such questions where options look similar. In such cases it is a better approach to remove all the apparent wrong options and then go for the tricky ones. In this question option A is ruled out because it is given as x=3, and = is not a comparison operator but a assignment operator and so x will be assigned the value of 3 and not compared. so A is ruled out. C is also ruled out because the presence of a ; at the end of (x==3) makes it as a independent statement and so the next statement which is y=5 will be executed irrespective of the result of the comparison. So C is ruled out.

Now we are left with only two options. It is either B or D. Since traditionally we enclose the operator to be compared within parenthesis i would choose D as the right answer. If anyone has any other explanation please post it to me.
Posted by Vani Chakraborty at 12:48 No comments: Email ThisBlogThis!Share to TwitterShare to Facebook

Saturday, 1 September 2012

December 2010 Question Paper - Question No 12


12. The value of the following expression (13 / 4 * 3) % 5 + 1 is (A) 5.75 (B) 2.95 (C) 1.4875 (D) 5 The answer is (D)

62

Explanation:-

The explanation for this question is very simple. According to the precedence of the different binary operators in C, * / and % precedes that of + and -. Since the expression enclosed in parenthesis is executed first, the expression which would be executed first is (13 / 4 * 3). Since all these operators precedence is the same, they would execute from left to right and so 13 / 4 gets executed first. 13 / 4 = 3 This intermediate answer is multiplied with 3 in order to get the answer 9. 3*3=9 The next expression would be 9 % 5. The result is 4. % is the mod operator. It gives the remainder of dividing two numbers. 9%5=4 Finally this 4 is added to 1 to get the final result of 5. It is always better to just know the precedence chart table of the different operators in C.
Posted by Vani Chakraborty at 13:57 No comments: Email ThisBlogThis!Share to TwitterShare to Facebook

Monday, 21 May 2012

DECEMBER 2010 PAPER SOLVED QUESTIONS 1 - 10


1. The number of integers between 1 and 250 that are divisible by 2,5 and 7 is A) 2 (B) 3 C) 5 (D) 8 Ans:- B. There are 3 integers between 1 and 250 that are divisible by 2,5 and 7. They are 70,140 and 210. 2. An undirected graph possess an Eulerian circuit if and only if it is connected and its vertices are A) All of even degree (B)All of odd degree C) Of any degree (D)even in number Ans:- A. According to Euler's theorem 1, if a graph is undirected then it has an eulerian circuit if and only if it is connected and each vertex has an even degree. ***It would be useful to know about the Hamiltonian circuit as well. 3. A partially ordered set is said to be a lattice if every two elements in the set have A)a unique least upper bound (B)a unique greatest lower bound C)both (A) and (B) (D)none of the above.

63

Ans:- C. 4. The minimum number of edges in a connected graph with 'n' vertices is equal to A)n(n-1) (B)n(n-1)/2 C)n2 (D)n-1 Ans:- D. The formula for counting the minimum number of edges in a connected graph is (n-1). 5. Would be done later..... 6. The decimal number equivalent of (4057.06)8 is : A) 2095.75 (B)2095.075 C) 2095.937 (D)2095.09375 Ans:- D. 7. Would be done later... 8. An astable multivibrator has A)one stable state (B)two stable states C)no stable states (D)none of these Ans:- C. An astable multivibrator has two states but neither of them are stable. 9.12-bit 2's complement of -73.75 is A) 01001001.1100 (B)11001001.1100 C) 10110110.0100 (D)10110110.1100 Ans:- B 10. Encoding of data bits 0011 into 7-bit even parity Hamming code is A)0011110 (B)0101110 C)0010110 (D)0011100 Ans:- A. The explanation is quite lengthy. If you google the question, you would get a link to the book "Fundamentals of digital circuit" by A.Anand Kumar. The explanation is great there. 11. How many of the following declarations are correct? int z=7.0; double void=0.000; short array[2]={0,1,2}; char c="\n"; (A) None (B)One is correct (C) Two are correct (D)All four are correct Ans:-The second declaration is for sure wrong because we cannot have a keyword as a variable name. The last declaration is also wrong because we cannot assign anything within double quotes to a character variable. So we are left with only the first and the array
64

declaration.I think those two would still not give errors in c. So 'C' could be the answer for this question.

To be continued later...

DBMS

In DBMS, there could be a question on different steps in normalization and what is achieved at the end of every step in it.You need to be knowing the following things very clearly and without any ambiguity.The question would be based on these terms.

A table is in 1NF if there and no duplicate rows in the table. Each cell is single-valued. A table is in 2NF if it is in 1NF and if all non-key attributes are dependent on all of the key. A table is in 2NF if it is in 1NF and if it has no partial dependencies A table is in 3NF if it is in 2NF and if it has no transitive dependencies A table is in BCNF if it is in 3NF and if every determinant is a candiate key. A table is in 4NF if it is in BCNF and it it has no multi-valued dependencies. A table is in 5NF if it is in 4NF and it has no join dependency.

Superkey,Candidate key,Primary key


A superkey is any set of attributes such that the values of the attributes(taken together)uniquely identify one entity in the entity set. A candidate key is a minimal superkey. A primary key is one of the candidate keys, designated by the Database designer.

Posted by Vani Chakraborty at 04:38 2 comments: Email ThisBlogThis!Share to TwitterShare to Facebook

Friday, 12 August 2011

UGC NET SOLVED COMPUTER SCIENCE - PAPER II

65

This section is for all those NET exam aspirants who are looking out for a solution for UGC NET computer science papers. As a person who had taken the examination i have searched the internet incessantly for the solution of paper-II and paper-III of computer science. Since i could not find any solid help(or rather no help at all) in this regard, i had decided to write my own blog posting the solution for each and every paper as and when i complete it. I have posted the solution for paper-II of December 2008(and it was quite a task). Wherever i could, i have given explanation for the answers. If it is too lengthy or too simple, i have left it out. Enjoy your preparation for the NET exam. I just have one word of advice for all NET aspirants... "Focus on the journey, not the destination. Joy is found not in finishing an activity but in doing it.

DECEMBER 2008 PAPER II SOLVED

DECEMBER 2009 PAPER II SOLVED

DECEMBER 2008 PAPER II SOLVED

1. The channel capacity of a band-limited Gaussian channel is given by (A). B log2 (2+S/N) (B) B log2 (1+S/N) (C ).B log10(1+S/N) (D). B loge(1+S/N) Ans : B. Explanation :- C=B log2 (1 + S/N) where C is the capacity in bits per second. B is the bandwidth of the channel in Hertz and S/N is the signal to noise ratio.

2. The graph K 3,4 has _______ edges. (A). 3 edges (B) 4 edges (C ). 7 edges (D) 12 edges Ans : D. A bipartite graph is a complete bipartite graph if every vertex in U is connected to every vertex 66

in V. If U has n elements and V has m, then the resulting complete bipartite graph can be denoted by K n,m and the number of edges is given by n*m. The number of edges = K 3,4 = 3 * 4 = 12

3. The total number of spanning trees that can be drawn using five labeled vertices is: (A). 125 (B).64 (C ). 36 (D). 16 Ans : A. According to cayleys formula for counting spanning trees, for a complete graph Kn, T(Kn)= n n-2 where n is the number of vertices. T(k5)=5 5-2=5 3= 5 * 5 * 5=125

4. Extremely low power dissipation and low cost per gate can be achieved in (A) MOS ICS (B) C MOS ICS (C ) TTL ICS (D) ECL ICS Ans : B. CMOS ICS

5. An example of a universal building block is : (A). EX-OR Gate (B). AND Gate (C ). OR gate (D). NOR Gate Ans:- D. Universal gates are the ones which can be used for implementing any gate like AND,OR and NOT or any combination of these basic gates. Apart from the NOR gate, NAND gate is also considered as universal gate.

6. An example of a layer that is absent in broadcast networks is : (A). Physical layer (B). Presentation layer (C ). Network layer (D). application layer Ans : C. 7. The ATM cell is : (A). 48 bytes long (B). 53 bytes long (C ). 64 bytes long (D). 69 bytes long Ans: B. An ATM cell always consists of a 5-byte header followed by a 48-byte payload. So the size is 53 bytes long. 8. Four jobs J1,J2,J3, and J4 are waiting to be run. Their expected run times are 9,6,3 and 5 respectively. In order to minimize average response time, the jobs should be run in the order: (A). J1 J2 J3 J4 (B). J4 J3 J2 J1 67

(C ) J3 J4 J1 J2 (D) J3 J4 J2 J1 Ans : D 9. Suppose it takes 100ns to access page table and 20 ns to access associative memory. If the average access time is 28ns, the corresponding hit rate is: (A). 100 percent (B). 90 percent (C ). 80 percent (D). 70 percent Ans : B 10. Transmission of N signals , each band limited to Fm Hz by TDM, requires a minimum band-width of (A).fm (B) 2 fm (C ) N fm (D) 2N fm Ans : C. Minimum transmission band-width of TDM channel is given by the following equation. Bt=NW Where N is the total number of channels, which are bandlimited to W Hz. In the above problem, the number of signals are N, each band limited to Fm Hz and so the minimum band-width is N fm.

11. If a code is t error detecting, the minimum hamming distance should be equal to : (A). t-1 (B). t (C ). t+1 (D). 2t+1 Ans: C. To guarantee the detection of upto s errors in all cases, the minimum hamming distance in a block code must be dmin=s+1 So, the minimum hamming distance for a t error detecting must be t+1

12. A relation R in {1,2,3,4,5,6} is given by {(1,2),(2,3),(3,4),(4,4),(4,5)}. The relation is : (A) Reflexive (B). symmetric (C ). Transitive (D). not reflexive, not symmetric and not transitive Ans:- D.

13. The dual of the switching function x+yz is: (A). x+yz (B). x+yz (C ). x(y+z) (D). x(y+z) Ans:- D 14. The characteristic equation of D-flip flop is : (A). Q=1 (B). Q=0 (C ). Q=D (D). Q=D Ans: D. 68

15. If four 4 input mulitplexers drive a 4 input multiplexer we get a : (A). 16 input MUX (B). 8 input MUX (C ). 4 input MUX (D). 2 input MUX Ans:- A

16. The throughput of slotted ALOHA is given by: (A). S=G (B). S=GeG (C ). S=Ge-G (D). S=eG Ans: C

17. Congestion control is done by (A). Network layer (B). Physical layer (C ). Presentation layer (D). Application layer Ans:- A. Addressing, internetworking, error handling, packet sequencing are its other jobs.

18. Assertion(A): Twisted pairs are widely used as transmission medium. Reasoning(R ): Twisted pairs have adequate performance and low cost. (A). Both (A) and (R ) are true and (R ) is the correct explanation for (A). (B). Both (A) and (R ) are true but (R ) is not the correct explanation (C ). (A) is true but (R ) is false (D). (A) is false but (R ) is true Ans:- A. Page No .91 of Tanenbaum book, you will find the following statement. Due to their adequate performance and low cost, twister pairs are widely used and are likely to remain so for years to come.

19. An example of a non-adaptive routing algorithm is: (A). Shortest path routing (B). Centralised routing (C ). Barans hot potato algorithm (D). Barans backward learning algorithm Ans:- A. Shortest path routing.

20. IP address in B class is given by: (A). 125.123.123.2 (B). 191.023.21.54 (C ). 192.128.32.56 (D). 10.14.12.34 Ans:- B

69

21. N processes are waiting for I/O. A process spends a fraction of its time in I/O wait state. The CPU utilization is given by: (A). 1-P N (B). 1 P N (C ). P N (D). P -N Ans:B. According to the probabilistic model, if a process spends a fraction p of its time in I/O wait state, and if there are N processes in memory, then the CPU utilization is given by 1-PN

22. If holes are half as large as processes, the fraction of memory wasted in holes is: (A) 2 / 3 (B). 1 / 2 (C ). 1 / 3 (D). 1 / 5 Ans : D

23. An example of a non-premptive scheduling algorithm is: (A). Round robin (B). Priority scheduling (C ). Shortest job first (D). 2 level scheduling Ans: C 24. An example of a distributed OS is: (A). Amoeba (B). UNIX (C ). MS DOS (D). MULTICS Ans: A 25. Which one of the following correctly describes a static variable: (A). It cannot be initialized. (B). It is initialized once at the commencement of execution and cannot be changed during run time. (C ). It retains its value during the life of the program. (D). None of the above Ans: C 26. The output of the program code main() { int x = 0; while ( x < = 10) for(;;) if (++x%10==0) break; printf(x=%d,x); } is: 70

(A). x = 1 (B). compilation error (C ). x = 20 (D) none of the above Ans:- C. For the while statement there is a for loop inside. For the for loop, there is one if condition, based on which there is a break statement. Since the value of x initially is 0, the while condition would be true and the for loop would start executing. The if statement condition would be checked, since ++x would become 1 and 1%10 is not equal to 0, break will not be executed. Since for is infinite x value will go on increasing. Once the value of x reaches 9, ++x would become 10 and 10%10==0 and so break would be executed. So control will come out of the innermost loop and would go to the outer loop. Sinc the value of x is 10, and since it is equal to 10, once again the for loop would start its execution. Once the value of x reaches 20, 20%10 will be equal to 0 and again break will be executed and control would go to the outer for loop. When the condition is checked for x<=10,it is false as the value of x is 20 and so it comes out of the while loop and the printf statement gets executed, printing the value of 20. Whew!!!!! 27. A copy constructor is invoked when : (A). a function returns by value (B). an argument is passed by value (C ). A function returns by reference (D). none of the above Ans:- B 28. When a language has the capability to produce new data types, it is said to be : (A). extensible (B). encapsulated (C ). Overloaded (D). none of the above Ans:-A 29. How many constructors can a class have? (A) Zero (B) 1 (C ) 2 (D) any number Ans:- D 30. An entity has: (i) a set of properties (ii) a set of properties and values for all the properties (iii) a set of properties and the values for some set of properties may non-uniquely identify an entity (iv) a set of properties and the values for some set of properties may uniquely identify an entity Which of the above are valid? (A) (i) only (B) (ii) only (C ) (iii) only (D) (iv) only Ans:- D 31. Aggregation is: (A) An abstraction through which relationships are treated as lower level entities (B) An abstraction through which relationships are treated as higher level entities (C) An abstraction through which relationships are not treated at all as entities (D) None of the above Ans:- B 32. Suppose R is a relation schema and F is a set of functional dependencies on R. Further, suppose R1 and R2 forma a decomposition of R. Then the decomposition is a lossless join decomposition of R provided that : (A) R1R2 ->R1 is in F+ (B) R1 R2->R2 is in F+ (C) Both R1 R2->R1 and R1 R2->R3 functional dependencies are in F+ (D)At least one from R1R2->R1 and R1 R2->R2 is in F+ Ans:- D.

33. In a heap, every element is ________________ of all the elements in the subtree. (A) Maximum (B) minimum (C ) sum (D) product Ans:- A

34. If (rear == maxsize 1) rear=0; else rear=rear+1; is required in : (A) circular queue (B) linear queue (C) stack (D) deque Ans:- D

71

35. A high performance switching and multiplexing technology that utilizes fixed length packets to carry different types of traffic is : (A) ATM (B) ADSL (C) SONET (D) None of the above Ans:- A

36. A conventional LAN bridge specifies only the functions of OSI: (A) Layers 1 and 2 (B) layers 1 through 3 (C) all layers (D) none of the above Ans:- A.

37. An assembly program contains: (A) Imperative and declarative statements (B) Imperative statements and assembler directives (C) Imperative and declarative statements as well as assembler directives (D) Declarative statements and assembler directives Ans:- C. Assembly program consists of three types of statements. 1. Imperative 2. Declarative 3. Assembler directives 38. In which addressing mode, the effective address of the operand is generated by adding a constant value to the contents of a register? (A) Absolute mode (B) immediate mode (C) indirect mode (D) index mode Ans:- D

39. Which of the following are Assembler directives? (i) EQU (ii) ORIGIN (iii) START (iv) END (A) (ii),(iii) and (iv) (B) (i),(iii) and (iv) (B) (iii) and (iv) (D) (i),(ii),(iii) and (iv) Ans:- D

40. Which of the following OS treats hardware as a file system? (A) UNIX (B) DOS (C) Windows NT (D) none of the above Ans:- A. 41. In which of the following, ready to execute processes must be present in RAM? (A) Multiprocessing (B) multiprogramming (C) multitasking (D) all of the above

72

42. If the executing program size is greater than the existing RAM of a computer, it is still possible to execute the program if the OS supports: (A) Multitasking (B) virtual memory (C) paging system (D) none of the above Ans: B

43. Software Quality Assurance (SQA) encompasses: (A) Verification (B) validation (C) both verification and validation (D) none of the above

44. Which level is called as defined in capability maturity model? (A) Level 0 (B) level 3 (C) level 4 (D) level 1 Ans:- B

45. COCOMO model is used for: (A) Product quality estimation (B). product complexity estimation (C) product cost estimation (D) all of the above Ans: C

46. Font sizes are usually expressed in points. One point is: (A) 0.0069 inch (B) 0.0138 inch (C) 0.0207 inch (D0 0.0276 inch Ans:- B. One point is 1/72 of an inch and so we will get the answer 0.0138 inch.

47. Assertion (A): Cellular telephone systems can handle a multitude of users. Reasoning(R ): Cellular telephone systems permit extensive frequency reuse in a small local area. (A) Both (A) and (R ) are true and (R ) is the correct explanation for (A) (B) Both (A) and (R ) are true but (R ) is not the correct explanation (C) (A) is true but (R ) is false (D) (A) is false but (R ) is true Ans:- A.

48. E-Commerce involves: (A)Electronic Data Interchange (B) Electronic mail (C) Electronic Bulletin boards (D) All of the above Ans:- D. E-commerce involves paperless transactions and usage of EDI(Electronic Data Interchange), electronic mail, bulletin boards, fax transmission and electronic fund transfers.

73

49. An example of a data mining algorithm which uses squared error score function is: (A) CART algorithm (B) back propagation algorithm (C) a priori algorithm (D) vector space algorithm Ans:- B. Back propagation algorithm uses squared error score function. CART algorithm uses crossvalidated loss function.

50. (I) Each object in the active directory of windows 2000 has an access control list. (II) The scheme is a blueprint of all objects in the domain of windows 2000. Which of the following is true? (A) Only (I) (B) only (II) (C) both (I) and (II) (d) none of the above Ans:- C

DECEMBER 2009 PAPER II SOLVED

1. If she is my friend and you are her friend, then we are friends. Given this, the friend relationship in this context is ________________. (i) Commutative (ii) transitive (iii) implicative (iv) equivalence (A) (i) and (ii) (B) (iii) (C) (i),(ii),(iii) and (iv) (D) None of these Ans:- D 2. Circle has ________ (A) No vertices (B) only 1 vertex (C) vertices (D) None of these Ans :- A 8. The highest noise margin is offered by (A) BICMOS (B) TTL (C) ECL (D) CMOS Ans:- B 9. The answer of the operation (10111)2 * (1110)2 in hex equivalence is (A) 150 (B) 241 (C) 142 (D) 101011110 Ans:- C 10. How many 1 are present in the binary representation of 3 X 512 + 7 X 64 + 5 X 8 + 3 (A) 8 (B) 9 (C) 10 (D) 11 Ans:- B

74

11. Recursive functions are executed in a (A) First in first out order (B) Last in first out order (C ) Parallel fashion (D) Load Balancing Ans: B 12. What would be the output of the following program, if run from the commandline as myprog 1 2 3? main(int argc,char *argv[]) { int i; i=argv[1]+argv[2]+argv[3]; printf(%d,i); } (A) 123 (B) 6 (C) Error (D) 123 Ans:- C 13. A ________________ is a special method used to initialize the instance variable of a class. (A) Member function (B) Destructor (C) Constructor (D) structure Ans:- C 14. Encapsulation is (A) Dynamic binding (B) A mechanism to associate the code and data (C ) Data abstraction (D ) Creating new class Ans:- B 15. Which of the statements are true? I. Function overloading is done at compile time. II. Protected members are accessible to the member of a derived class. III. A derived class inherits constructors and destructors IV. A friend function can be called like a normal function. V. Nested class is a derived class. (A) I,II,III (B) II,III,V (C) III,IV,V (D) I,II,IV Ans:- D 16. The E-R model is expressed in terms of I. Entities II. The relationship among entitites III. The attributes of the entities. IV. Functional relationship. (A) I,II (B) I,II, IV (C) II,II,IV (D) I,II,IV 75

Ans:- D 17. Specialization is ________________process. (A) top-down (B) bottom up (C ) both (A) and (B) (D) none of these Ans:- A 18. Match the following: (1) Determinants (a) No attributes (2) Candidate key (b) Uniquely identified a row (3) Non-redundancy (c ) A constraint between two attributes (4) Functional dependency (d) Group of attributes on the left hand side of arrow of function dependency (A) 1 d, 2 b, 3 a, 4 c (B) 2 d, 3 a, 1- b, 4 c (C) 4 a, 3 b, 2 c, 1 d (D) 3 a, 4 b, 1 c, 2 d Ans:- A. 19. A function that has no partial functional dependencies is in _____________ form. (A) 3 NF (B) 2 NF (C) 4 NF (D) BCNF Ans:- B 20. Which of the following statement is wrong? I. 2-phase locking protocol suffer from dead lock. II. Time stamp protocol suffer from more aborts. III. A block hole in a DFD is a data store with only inbound flows. IV. Multivalued dependency among attribute is checked at 3 NF level. V. An entity-relationship diagram is a tool to represent event model. (A) I ,II,III (B) II,III,IV (C) III,IV,V (D) II,IV,V Ans:- A 21. If the number of leaves in a strictly binary tree is an odd number, then what can you say with full conviction about total number of nodes in a tree? (A) It is an odd number. (B) It is an even number. (C ) It cannot be equal to the number of leaves. (D ) It is always greater than twice the number of leaves. Ans:- A. Strictly binary tree with N leaves contains 2N-1 nodes. So when the number of leaves is odd number then the total number of nodes in the tree also will be odd if we apply the above formula. 22. The number of edges in a complete graph of n vertices is 76

(A) n (B) n(n-1)/2 (C ) n(n+1)/2 (D) n2/2 Ans:- B. The complete graph on n vertices has n(n-1)/2 edges. 23. At a hill station, the parking lot is one long drive way snaking up a hill side. Cars drive in and park right behind the car in front of them, one behind another. A car cant leave until all the cars in front of it have left. Is the parking lot more like (A) An array (B) A stack (C) A queue (D) A linked list Ans:- C. 24. With regard to linked list, which of the following statement is false ? (A) An algorithm to search for an element in a singly linked list requires O(n) operations in the worst case. (B) An algorithm for deleting the first element in a singly linked list requires o(n) operations in the worst case. (C ). An algorithm for finding the maximum value in a circular linked list requires o(n) operations. (D ). An algorithm for deleting the middle node of a circular linked list requires o(n) operations. Ans:- B 25. A hash function f defined as f(key)=key mod 7, with linear probing used to resolve collisions. Insert the keys 37,38,72,48,98 and 11 into the table indexed from 0 to 6. What will be the location of 11? (A) 3 (B) 4 (C ) 5 (D) 6 Ans:- C 26. Device on one network can communicate with devices on another network via a (A) Hub/switch (B) Utility server ( C) File server (D) Gateway Ans:- D 27. What is the maximum window size in sliding window protocol used in a computer network? (A) 4 (B) 8 (C ) 15 (D) 16 Ans:- A 28. Which of the following are Data Link Layer standard? 1. Ethernet 2. HSSI 3. Frame Relay 4. 10-Base T 5. Token Ring (A) 1,2,3 (B) 1,3,5 (C) 1,3,4,5 (D) 1,2,3,4,5 Ans:- C 29. In case of Bus/Tree topology signal balancing issue is overcome by (A) Modulation (B) Polling (C ) Segmentation (D) Strong transmitter Ans:- C 77

30. Match the following: (i) Ethernet (a) Deterministic (ii) Token Ring (b) Utilize the full wire speed (iii) Cut-through switch (c ) Prevent Looping (iv) Spanning tree (d) Checking valid address Codes: (A) i-d,ii-a,iii-b,iv-c (B) i-a,ii-d,iii-b,iv-c (C ) i-d,ii-d,iii-c,iv-b (D) i-d,ii-c,iii-b,iv-a Ans:- A 31. In an absolute loading scheme which loader function is accomplished by assembler? (A) re-allocation (B) allocation (C ) linking (D) loading Ans:- A. Implementation of Absolute loader: The four loader functions are performed as following: 1.Allocation- By programmer 2.Linking- By programmer 3.Relocation- By assembler 4.Loading- By loader 32. Which of the following grammar is LR(1)? (A) A->aAb, A->bAb,A->a,A->b (B) A->aAa,A->aAb,A->c (C ) A->A+A,A->a (D)Both (A) and (B) 33. A shift-reduce parser carries out the actions specified within braces immediately after reducing with the corresponding rule of the grammar. S->xxW* print 1 + S->y * print 2 + W->S2 * print 3 }, what is the translation of x x x x y z z? (A) 1 1 2 3 1 (B) 1 1 2 3 3 (C) 2 3 1 3 1 (D) 2 3 3 2 1 Ans:- C 34. Context-free Grammar(CFG) can be recognized by (A) Finite state automata (B) 2-way linear bounded automata (C ) push down automata (D ) Both (B) and (C) Ans:- D 35. Synthesized attribute can be easily simulated by a (A) LL grammar (B) Ambiguous grammar (C ) LR grammar (D) None of the above Ans:- C

78

36. In the process management Round-robin method is essentially the pre-emptive version of _______________. (A) FILO (B) FIFO (C ) SSF (D) Longest time first Ans:- B 37. A page fault (A) is an error specific page (B) is an access to the page not currently in memory (C ) occur when a page program occur in a page memory. (D ) page used in the previous page reference. Ans:- B 38. A semaphore count of negative n means (s=-n) that the queue contains ___n__________ waiting processes. (A) n + 1 (B) n (C) n 1 (D) 0 Ans:- B 39. A program is located in the smallest available hole in the memory is ______________ (A) best-fit (B) first-bit (C ) worst-fit (D ) buddy Ans:- A 40. The unix command used to find out the number of characters in a file is (A) nc (B) wc (C ) chcnt (D) lc Ans:- B 41. Software Engineering is a discipline that integrates __________ for the development of computer software. (A) Process (B) Methods (C ) Tools (D) All Ans:- D 42. Any error whose cause cannot be identified anywhere within the software system is called _________________. (A) Internal error (B) External error (C ) Inherent error (D) Logic error Ans:- B 43. Recorded software attributes can be used in the following endeavours: (i) Cost and schedule estimates. (ii) Software product reliability predictions (iii )Managing development process (iv). No where 79

Codes: (A) (i) (ii) (iv) (B) (ii) (iii) (iv) (C) (i) (ii) (iii) (D) (i) (ii) (iii) (iv) Ans :- C 44. Black box testing is done (A) To show that s/w is operational at its interfaces i.e. input and output. (B) To examine internal details of code (C) At client side (D) None of the above Ans:- A 45. The name of the transaction file shall be provided by the operator and the file that contains the edited transactions ready for execution shall be called (A) Batch.exe (B) Trans.exe (C ) Opt.exe (D) Edit.exe Ans:- C 46. The single stage network is also called (A) One sided network (B) two sided network (C ) recirculating network (E) pipeline network Ans:- C. The single stage network is also called a recirculating network. 47. Analysis of large database to retrieve information is called (A) OLTP (B) OLAP (C ) OLDP (D) OLPP Ans:- B 48. Which technology is sometime referred to as wireless cable? (A) MMDS (B) ATM (C ) LMDS (D) CDMA Ans:- A. MMDS stands for multipoint multichannel distribution system. MMDS is a broadband wireless technology. 49. Another name of IEEE 802.11 a is ______________ (A) Wi-Max (B) Fast Ethernet (C) Wi-fi (D) 802.11 g Ans:- C. IEEE 802.11 standards provide the basis for Wi-fi networks. 50. The unlicensed National Information Infrastructure band operates at the ____________frequency (A) 2.4 GHz (B) 5 GHz (C ) 33 MHz (D) 5 MHz Ans:- B Posted by Vani Chakraborty at 23:20 20 comments:

80

Email ThisBlogThis!Share to TwitterShare to Facebook

JAVA - BANGALORE UNIVERSITY


I am currently handling java programming for my BCA students. Apart from the classroom setting, i feel this is another forum for my students to interact with me and get their doubts clarified. Many students feel shy to ask questions in the classroom and keep quiet even if they do not understand a topic. So i am trying to write on certain specific topics which I am sure lot of students would still be having doubts. Please go through the topics, and if you want me to answer any particular doubts you have, feel free to post about them and i will explain it for you here. HAPPY LEARNING!!!!!!. COMMAND LINE ARGUMENTS ARRAYS IN JAVA

APPLET PROGRAMMING JAVA QUESTION BANK

COMMAND LINE ARGUMENTS

Command line argument is a topic which we practically start our learning of java, but i am sure still there are students who are not clear about this. Here goes the explanation. Read it more than once if you are still not clear, you will get it. Execution in a java program starts from the main method which we write in a class. When we write any method in java, you can pass parameters to it and the method can also return a value. Since "main" is also a method, parameters can also be passed to it but the only thing is that those parameters must be passed from the command line, when you invoke the java interpreter for executing the class file.
For example, if a class file called test is executed by the java interpreter, and command line arguments are passed to it, the invocation would like this , c:\>java test one two three In the above example, three command line arguments are passed and they are the string one, two and 81

three respectively. The complete program to handle these command line arguments would go like this,
class test { public static void main(String args[]) { /* Arguments sent from the command line are stored in the args array. Length of the args array would be equal to the no of arguments passed. Following code simply prints the array elements */ for(int i=0;i<args.length;i++) System.out.println(args[i]); } }

POINTS TO BE NOTED WHILE USING COMMAND LINE ARGUMENTS 1. Understand very clearly the data type of args. It is a array of strings. That is why it is declared as String args[]. args is just a variable name given to the array of strings which stores the command line arguments. It can be called anything, x,y or z. 2. Any data can be sent using command line arguments. But they are always copied into the string array only. So if any number is passed and should be treated like a number, we should convert it into a int data type using appropriate methods in java. (Like parseInt method called with the Integer class to convert the String into primitive int data type). 3. One of the useful applications of command line arguments would be to work with files, let us say. Suppose i am writing a class called copy which works like any other copy program. copy a source file to a destination file. The two file names can be given as command line arguments instead of accepting it from the user. c:\>java copy file1 file2 Here file1 and file2 are command line arguments and there are statements in the copy class to copy file1 into file2.

APPLET PROGRAMMING
Applets are small java programs that are primarily used in internet computing. They are a piece of code which is downloaded by the browser and run at the client side. Applets can be used for doing any activity which we want to do. Say, for example, developing a user registration form, running a game program, a paint application, an EMI calculator etc.

82

Every applet that we write has to be extended from the built in class called Applet. This class is available in the applet package and so that should be imported. An example program for an applet would include an import statement for importing the applet package. import java.applet.*; import java.awt.*; The awt package must be imported because it contains the Graphics class which is going to used in applet programming. Because of that reason, awt package also must be imported. Let us say, we want to write a applet called testapp then the class definition for it should go like this, public class testapp extends Applet { // Enclose the code for the applet } There are many methods executed in the life cycle of applet and they are 1. public void init() 2. public void start() 3. public void stop() 4. public void destroy() init() This method contains any initialisation code. start() This method is executed once init() finishes its execution. When a web page which contains the applet gets its focus, this method will be executed. So in the life cycle of an applet, this method could be executed more than once. stop() This is executed when a web page containing an applet loses its focus. destroy() This is the last method to be executed in the applet's life cycle and this will be executed only once.
83

Apart from all these methods, we should be familiar with one more method which would be frequently used in our learning of applet and it is the paint mehtod. The signature for this method is , public void paint(Graphics g) { } This method takes a Graphics object as its parameter. The Graphics class has lot of methods for drawing mamy different types of shapes, from simple to complex. The following is a program for printing a "Hello world " import java.applet.*; import java.awt.*; public class testapp extends Applet { public void paint(Graphics g) { g.drawString("Hello world",100,100); } }

Parameter passing in applet


Just like how, values can be passed to the main method using command line arguments, we can also pass arguments to an applet. The arguments are passed using the PARAM tag using a name and value attribute. In the init method of the applet the parameter's values have to be captured and worked further upon. Let me first write the java program to capture the arguments. ;

import java.awt.*; import java.applet.* public class testparam { String str=" "; public void init() { str=getParameter("name"); repaint(); } public void paint(Graphics g) { g.drawString(str,200,200); } } The second part is to write the html code which has the applet embedded and also the param tag for passing the parameters.
84

< html > < body > < applet code="testparam" width=400 height=400 > < param name="name" value="JAVA" > < body > < html >

JAVA QUESTION BANK

The question bank comprises of PART A and PART B questions. PART A questions are 1 mark or 3 mark questions. PART B comprises of 7 mark questions. PART A

PART B

PART A 1. Expand WWW,HTML,JDK,JVM,JRE,API and AWT. 2. Explain few methods available with the Math class. 3. What are the different types of comments available in java? 4. What are the rules for naming an identifier. 5. Why is java called platform independent? 6. What is a JVM? 7. How to create symbolic constant in java? 8. Write the syntax of switch statement in java. 9. What are labelled loops? 10. What are static members? 11. What is inheritance? 12. What are the different types of inheritance? 13. What are the consequences of making a class final? 14. What is the use of making a method final? 15. What are wrapper classes in java? 16. Name some inbuilt packages in java. 17. What are the different priorities that can be assigned to a thread? 18. Name some methods used for inter-thread communication. 19. How many catch blocks can be there for a single try block? 20. Name some differences between applets and applications. 85

21. Write a simple html file for embedding a applet. 22. Name some methods available in the Graphics class for drawing purpose. 23. What are the attributes available with applet tag?. Explain few of them. 24. What is the difference between byte stream and character stream classes? 25. What is the purpose of pushbackinput stream class? 26. What is the purpose of piped stream class? 27. Name some methods available with inputstream class? 28. Name some methods available with outputstream class? 29. What are the different modes of opening a file using Randomaccessfile class? 29. How to draw a polygon in java? 30. Name some important events available in java. PART B 1. Explain the features of java. 2. How java differs from c and c++. 3. Explain the general structure of a java program. 4. Explain the different types of statements in java with example. 5. Explain command line arguments with an example. 6. Explain the data types in java with an example. 7. Eplain instance variables, class variables and local variables with an example. 8. What are constructors? Explain with an example. 9. What is method overloading? Explain with an example. 10. Illustrate method overriding with an example. 11. What are abstract methods?. Explain with an example. 12. Write the steps for creating an array in java with an example. 13. Explain atleast 10 string functions in java. 14. What are interfaces? Explain with an example. 15. What are packages? Write the steps for creating a package with an example. 16. What are threads?. What are the two different ways of creating a thread? 17. Explain the lifecycle of a thread with a neat diagram. 18. Explain the five keywords of exception handling. 19. Explain the life cycle of applet with a neat diagram. 20. How to pass parameters to applets?. Explaintream with an example. 21. Explain the hierarchy of input stream classes with a digram. 22. Explain the hierarchy of output stream classes with a neat diagram. 23. Explain the hierarchy of input stream classes with a neat diagram. 24. Explain the random access file class in java with an example. 25. What is a File class?. Explain some important methods available with this class.

86

ARRAYS IN JAVA

Here i am assuming that the readers will know about how arrays are handled in c and c++. The main focus is on how java handles arrays and what are the unique features in its declaration. In c or c++, whenever we declare an array we have to mention the size of the array(i am not talking about dynamic allocation of arrays using malloc or new operator). But in java when an array is declared you just mention that it is an array by writing empty square brackets next to the name of the array. For example, if we want to declare an integer array which will be called as arr, the declaration would go like this, int arr[]; The size of the array would be mentioned when memory is allocated for it. arr=new int[5]; Memory for the array arr is allocated and arr contains the reference to the set of five contiguous memory locations. Points to be noted: 1. Individual elements of the array are accessed by using the arrayname[indexname]syntax. 2. If we overstep ar array in java, it generates an ArrayIndexOutOfBoundsException and comes out of the program. I just cannot overemphasize the importance of staying within the array bounds in java. If you overstep, java will not keep quiet and it will mouth exceptions like the one mentioned above. So, JUST BE PREPARED.. 3. In java, if we are talking about two-dimensional arrays, all the rows need not have the same column. Each one of the rows can be having a different number of columns. Such arrays are called jagged arrays. A very interesting and a different way of working with arrays. I would explain it with an example. class jaggedarr { public static void main(String ar[]) { int twodim[][]; twodim=new int[3][]; int i,j; for(i=0;i<twodim.length;i++) { twodim[i]=new int[i+1]; for(j=0;j<twodim[i].length;j++) { twodim[i][j]=1; System.out.print(twodim[i][j]+" ");
87

} System.out.println(); } } } In the above example, the array twodim is declared as one having 3 rows, but the number of columns are given based on the value of i. So, the first row has one column, second row has two columns and third row has three columns.

88

You might also like