Computer Applications
Q. 1.
- What is OOP’s
and define its basic concept.
- What is a class
and how it is declared?
- What do you mean
by Abstraction and Encapsulation?
- Write the
difference between Class and Object.
- What is class?
How are objects related to the class ?
Q. 2.
- What are the
keywords?Can keyword used as identifier.
- Is Java case
sensitive ? What is the mean by case sensitive .
- What is the
function of operator?
- What is the
difference between throw and throws?
- What are
instance variable and instance methods
Q. 3.
- Write a
statement that uses a conditional operator to set grant to 10 if speed is more
than 68 and to 0 otherwise
- How many times
are the loop execute ?
- x = 5; y = 50;
while (x<=y)
{
x=y/x;
} - ints = 0; i =
0;
while (i++<5)
s+=i;
Q. 4. Give
the output of the following statements
- math.ciel(-28.25)
- math.rint(38.96)
- Math.floor (
144.99)
- Math.abs (
3489.45)
- Math.max (
Math.min (15, 25), 5)
- ( int )
(“scholar”.charAt(2))
- “TuTOrIAl”.indexOf(‘l’)
- “MISSISSIPPI”.lastindexOf(‘S’)
- “kumarvivek”.substring(
3, 4)
- 0
Math.sqrt(100);
Q. 5. Design
A Class amicable(int,int) with a default constructor, a parameterized
constructor and the following two functions :
- checkAmicable(int,int)
– this function returns true if the two arguments are amicable otherwise
it returns false.
- main(int,int) –
this function invokes the above function and prints whether the parameters
passed to it are amicable or not.
Hint : a pair of numbers are amicable if the sum of the factors
of one number (excluding itself) is equal to the second number and vice-versa.
Q. 6. Write a
program to create 2 one dimensional array having 10 elements each. Merge both
the array to array M[].Display the resultant array
Q. 7. Write a
function to suppress negative elements of an array to bottom without altering
the original sequence i.e. if array contains 5 , -4 , 3 , -2 , 6 , -11 , 12 ,
-8 , 9 Then the return array will be : 5 , 3 , 6, 12 , 9 , -4 , -2 , -11 , -8
Q. 8. Find
value of s , where
S= 2+ 3+ 4+ 4+ 6+ 8+ 6+ 9+ 12…..100 terms
S= 2! -4! +6! -8! …..n
S= 2! -4! +6! -8! …..n
Q. 9. Write a
program to input a sentence. Create a function convert(int n), where n is an integer
value in positive or negative. This function is used to encode or decode the
given string by shifting each character of a string the number of times as
specified by user.
Ex.- Input- Good Boy
Shift value –3
Output – Jrrg Erb
Shift value –3
Output – Jrrg Erb
Q. 10. Write a
program to accept 15 integers from the keyboard, assuming that no integer
entered is a zero. perform Selection Sort on the integers and then print them
in ascending order
No comments:
Post a Comment