info@tutorialdiary.com

Saturday, May 21, 2016

AMCAT question papers – Previous Questions with answers

6:49 AM

Share it Please
For the AMCAT test the model paper or last years papers will help you a lot to write the AMCAT test easily, so prepare with the AMCAT question papers given in the blog, it is available in our blog. Make sure you go through it.

To download it in a .doc file follw this link:
http://downloads.ziddu.com/download/25388068/AMCAT_programming_part1_amcatdetails.blogspot.in.docx.html





Q. -------------returns a value unlike -------------------
option a:Procedure. Subroutine
option b:Procedure. function
option c:Function. Method
option d:Function, Procedure 
Ans: d)

Q. which of the following statements are true?
1)IPV4 addresses are 32 bit long
2)IPV5 addresses are 64 bit long
3)IPV6 is also called internet protocols next generation
4)Address Resolution protocol is used to map ipv4 address to MAC addresses


Ans d)

Q. In a pseudocode
if a>b then
{some operation;}
else
a
a)max between(a,b) b)

min between(a,b)

c) max a

d)min b

Ans b)
Explanation: if a>b

some operation means//b wil print i.e small number

else

a will be printed because above condition fail and a become small number

i.e both conditions are small numbers are printed so itgives the min between(a,b)

Q. enum names {AMAR,AKBAR,ANTHONY} function main()

{

print AMAR print AKBAR print ANTHONY

}

What will be the output generated when the given code is executed?

(a)000 (b)012 (c)123 (d)111

Answer b)

Q. Pankaj makes a program to print the product of cubes of the first 10 whole numbers. She writes the

following program:
integer x = 0 // statement 1
integer sum = 0 // statement 2
while ( x < 10 ) // statement 3
{
sum = x*x*x // statement 4
x = x + 1 // statement 5
}
print sum // statement 6

Is her program correct? If not, which statement will you modify to correct it?

1 )No error, the program is correct

2) Statement 1

3)Statement 4

4)statement 6

5)statement 2


Ans: statement 2

Q. Which of the following sorting techniques have same worst case O(nlogn)?
(a)Heap Sort (b)Quick Sort (c)Insertion Sort (d)Selection Sort E)radix sort

Answer: marge,quick,redix,heap sort W.C-O(nlogn)

Q. 25) There is a class which contains two integers as private members. There are two member functions (public) defined on it, one to add the two integers and another to subtract the two integers. Ravi wants to add a new functionality, which enables multiplication of the two numbers. Which one of the following options he should adopt?
(a)He should define a third member function (public) which multiplies the two numbers.
(b)He should define member functions (public) to return value of both the integers and then multiply them in his code. By returning the values, he can in future do any operation on them giving extensibility to the code.
(c)He should define a third member function (private) which multiplies the two numbers.
(d)He should define member functions (private) to return value of both the integers and then multiply them in his code. By returning the values, he can in future do any operation on them giving extensibility to the code.

Ans: b)

Q.  What is the minimum number of division checks required to check whether a number is prime or not?
(a) (number-1) divisions

(b) (number) divisions

(c) (integer(number/2)-1) divisions


(d) sqrt(number) divisions

Ans: d)

Q.  Suppose that a graph is represented as adjacency matrix and a BFS(Breadth First search) algorithm is modified to handle such input graphs. Which of the following options refers to the running time of such an algorithm given that the number of vertices in the graph is V and number of edges is E?
(a) O(V*V)

(b)O(V*V+E)

(c)O(E*E+V)

(d)O(E*E)

Ans: a)


22) Parthiv has included several classes and their objects in his project. Now he wants to use something that will hold all these objects(of different classes). Which of the following options provides him with the best alternate?
(a)Store them in database (b)Final Class (c)Generic Class (d)Anonymous Class

Ans: c)

Q. A stack is implemented as a linear array A[0....N-1]. Noor writes the following functions for popping an element from the stack.
function POP(top,N)
{
if(X)
{
top=top-1
}
else
{
print"Underflow"
}
return top
Fill in the condition X

a) top1
d) top >=0

Ans: d)

How does inheritance relate to abstraction?

A). A base class is an abstraction of all its drive class 
B). base class is an abstraction of its base class
C). base class and drive class are abstraction to each other.
D). Inheritance prevent abstraction

Ans: a)

 

Q. function MyFunc1(integer n)
{
return n*2
}
function MyFunc2(integer n)
{
print "The value is " n
}

Which of the given two functions can be categorized as procedure?

1. MyFunc1
2. MyFunc2
3. Both MyFunc1 and MyFun2
4. a function cannot be a procedure.


Ans: 2)

0 comments:

Post a Comment