How To Exam?

a knowledge trading engine...


Uttarakhand Technical University 2008 Other Bachelor's Degree Computer Science University - Question Paper

Thursday, 07 February 2013 02:15Web

1.
(a) Java is both a programming language and a platform. Comment.
(b) what is polymorphism? How does function overloading implement polymorphism?
(c) a _________ constructor create objects through values passed to it.
(d) where can the subsequent members of a class be accessed: private, public protected?
(e) what is an Exception?
[ 2+2+1+3+2 = 10 ]

2.
(a) what is a compound statement? Support with an example.
(b) State 1 likeness and 1 difference ranging from while and do while loop.
(c) What is the significance of default clause in a switch statement?
(d) What is the function of operators? elaborate binary operators?
(e) What is meant by ‘floating constant’ in java?
[ 2+2+2+2+2 = 10 ]

3.
(a) enter any two variables through constructor parameters and write a program to swap and print the values.
(b) What is ‘call by value’ and ‘call by reference’?
(c) Differentiate ranging from if and switch statements.
(d) What is a ‘package’? provide an example.
[ 4+2+2+2 = 10 ]

4.
(a) mention any 2 various styles of expressing a comment in a program.
(b) State the difference ranging from a constructor and a method.
(c) Write a loop that displays numbers 2,4,6,8,..............18,20.
(d) Write an equivalent while loop for the subsequent for loop:
For (int i=2, sum=0; i<=20; i=i+2)
Sum+ = i; [ 2+2+3+3 = 10 ]


part B (60 Marks)

Attempt any 4 ques. from this part. Write all the programs in Java BlueJ environment and clearly discuss the steps using the mnemonics and comments wherever needed.


1. Write a program to initialize an array of five names and initialize a different array with their respective phone numbers. Search for a name input by the user, in the list. If found, display “Search Successful” and print the name along with the phone number, otherwise display “Name not enlisted. Try other names”. [ 15 ]

2. Write a program to obtain the sum of the series; S = one + x + x2 + ............... + xn. [ 15 ]

3. Write a program that doubles every element of an array A [4] [4]. [ 15 ]

4. Write a class with name employee and basic as its data member, to obtain the gross pay of an employee for the subsequent allowances and deduction. Use worthwhile variables. [15 ]

5. Write a program to generate all Armstrong numbers ranging from 100 and 500. An Armstrong number is 1 which is equal to the cubes of every of its digits. E.g. 153 = 13 + 53 + 33. [ 15 ]




( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER Uttarakhand Technical University 2008 Other Bachelor's Degree Computer Science University - Question Paper