Up PL
Up PL
com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
1
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
2
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
3
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
4
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
5
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
6
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
7
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
8
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
9
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
10
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
11
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
12
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
13
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
14
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
15
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
16
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
17
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
18
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
19
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
20
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
21
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
22
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
23
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
24
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
25
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
26
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
27
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
28
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
AMIE(I) STUDY CIRCLE, SECOND FLOOR, SULTAN TOWER, ROORKEE - 247667 (UTTARAKHAND) EMAIL: [email protected] Ph: (01332) 266328 Web: www.amiestudycircle.com
29
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
5'16:4AN:CP404 (1449)
PROGRAMMING LAI\IGUAGES
Time : Three hours
Maximum Marks : 100
Group A
1. (a) Differentiate between a compiler and an interpreter.
(Turn Over )
30
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
4. (a) Write a Java program to find the distance between two (e) What is dynamic binding ? Explain using an
given numbers in an array of size 100. example.
(D) Design and implementaJava class polynomial that 6. (a) Write aClC++ programto findthe sum of series
represents a polynomial with real coefficients. The I ^3+2^3+...*n^3.
coefficients of the polynomial should be passed as an
(6) Write aClC++ programwhich deletes the duplicate
array parameter with array type double in the
element of an array.
constructor of your class. Implement methods to add
two polynomials, multiplies a double value to a (c) Write program for concatenation two string
polynomial, to return the degree r of apol5momial, to ^ClC++-
usingthe pointer.
return the first derivative and to return the value/(x)
of a polynomial for a given value x. (d) Write a C/C# program to find the volume and surfac.e
area of a cube.
(c) Rational numbers are num.bers that can h,-: re.x.csentld
i,r- fi ti-aclic;i.,1'g, l,rh*rep is r,.r" in|e;tt,rr rir.i it,i.. ;r.iri-i ,
.
7 . (a) Write a Java prograrq calledArithmetic,
that taftes thrce
command-line arguments-hvo imtegens follourd by an
;'' , ii:.. .;' ;''' (1
31
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
arithmetic operator (*, -, * or l). The program shall (e) An n-bit Gray code is a sequence of n-bit strings
perforrn the corresponding operation on the two constnrcted according to certain rules. n: 3 :
integers and print the result. C(3) : ['000','001','01 1','010',' 1 10',' 1 1 l',' 101',' 100,].
(&) Write a Java progr&m to check the perfect number. A Find the construction rules and write a predicate with
positive integer is called a perfect number, if the sum of the following specification:o/ogay (N, C) : C is the
all its factors(excludingthe number itself, i.e., proper N-bit Gray code. 5
divisor) is equal to its value. For example, the number
6 is perfect because its proper divisors are 1,2 and 3 Group C
and 6 : 1"+ 2 + 3; but the number 10 is not perfect 9. Choose the conect answer for the following : l0 x2
because its proper divisors are 1, 2 and 5, and
(r) Which one ofthe following is not a valid flow control
10rt l+2+5. 5
statement ?
(c) Write a Java program to implement bubble sort (a) break;
algoritrm. (6) continueouter;
(d) Write a Java program to find second highest number
(c) return;
in an integer list without sorting the array. 5 (d) exrQ;
tr=0-(+Y) +z#i
(D) Write a Lisp function to determine the prime factors of After execution of this, what will be the values of x, y
a given positive integer. 4
and z?
For example : r@rime-factors 3 I 5)
Ouput:Q3 57) (a) x:4,y=l,z=5
(D) x=3,y=2,2=6
(c) Write a Lisp function to find whether a list is a (c) r = -7,!= l, z= 5
palindromeornot. 4 (O x=4,y=2,2=6
(d) Write a Lisp function to insert an element at a given (lir) The connectionless sockets
position into alist 4
(a) support only character streams.
Example : *(insqrt-at'STAR' (a b c d)2)
(D) can transmit to multiple receivers at the same
Output : (l STARA CD)
time.
32
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
33
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
:"*HT::,XAGES
Maximum Marks : 100
Gnoup A
(Turn Over )
34
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
C's memory management ? 6 (D) Write a class employee with two function get data and
put data to read the name and number of employee
35
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
and display them respectively. Drive two classes one (D) only from innermost swirch
manager and other scientist. In manager class add one (c) from the innermost loop or switch
more variable title. [n scientist class add more variable
@ none ofthe above
publication and display them.
(rrr) which ofthe following directive creates functions like
(c) Write a program to concatenate fwo strings using marcos ?
operator overloading. (a) #include
(d) Writethe special properties of the constructor functions. (b) #define
In which direction constructors and destructors are
(c) #undef
invoked when base class is one and derived class are
@ #iftlef
two ? (rv) which format specification is used in printf( )
function to print hexadecimal format
8. (a) Discuss with the help of examples the action of break
(q) %i
statement and the continue statement.
(D) Yoc
(D) Write a'C' program to calculate ttre frequencies of (c) Yox
ofalphabets is to be taken as input from the keyboard. (v) Which loopingconstnrctareyou guaranteedto enter?
(c) What is an algorithm ? Develop an algorithm to test (a) uilrile
whether a given number is a prime number. (b) do-while
(c) for
(d) What are the various storage classes available in 'C' ? @ none of the above
Give one example of each.
(vr) Which class is base for all Exception ?
Group C (a) Sting
(D) Error
9. Choose the correcl answer for the tbllowing : l0 x 2
(c) Throwable
(r) The && and I I operators
@ RuntimeExcePtion
(a) compare two numeric values
(vii) A top level calss may have only the following access
(b) combine two numeric values
(c) compare two Boolean values modffier.
36
AMIE Study Material & Admission Packages AMIE(I) Study Circle, Roorkee www.amiestudycircle.com
If(number > 0)
cout(' Number is Positive";
elas
cout(. Number is Negative,,;
What will be the output if number is equal to zf,lto?
(a) Number is Positive
(b) Number is Negative
(c) Both (a) and (D)
(d) None of the above
(rx) We can make a class abstract bY
(a) Declaring it abstract using the static keyword
(D) Declaring it abstract using the virtual keyword
(c) Making all member functions constant
@ Making at least one member function as pure
virtual fimction
37
You may download prospectus to buy excellent study
material for AMIE exams.