Exam Paper Print – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
siteicon
Exam Paper: ICSE2015 (JAVA) No. of Q.26
Q.01A 2

What are the default values of the primitive datatypes int and float?



Q.01B 2

Name any two OOP’s principles.



Q.01C 2

What are identifiers?



Q.01D 2

Identify the literals listed below:
(i) 0.5 (ii)’A’ (iii) false (iv) “a”



Q.01E 2

Name the wrapper class of char type and boolean type.



Q.02A 2

Evaluate the value of n if the value of p=5, q=19
int n = (q-p) > (p-q) ? (q-p) : (p-q);



Q.02B 2

Arrange the following primitive data types in an ascending order of their size:
(i) char (ii) byte (iii) double (iv) int



Q.02C 2

What is the value stored in variable res given below:
double res = Math.pow(“345”.indexOf(‘5’), 3);



Q.02D 2

Name the two types of constructors.



Q.02E 2

What are the values of a and b after the following function is executed, if the values passed are 30 and 50.

void paws(int a, int b) {
a = a + b;
b = a - b;
a = a - b;
System.out.println(a + " , " + b);
}


Q.03A 2

State the data type and the value of y after the following is executed :

char x = '7';
y = Character.isLetter(x);


Q.03B 2

What is the function of catch block in exception handling? Where does it appear in a program?



Q.03C 2

State the output of the following  program segment is executed :

String a = "Smartphone", b = "Graphic Art";
String h = a.substring(2, 5);
String k = b.substring(8).toUpperCase();
System.out.println(h);
System.out.println(k.equalsIgnoreCase(h));


Q.03D 2

The access specifier that gives most accessibility is __________ and the least accessibility is ___________ .



Q.03E 2

(i) Name the mathematical function which is used to find sine of an angle given in radians
(ii) Name a string function which removes the blank spaces provided in the prefix and suffix of a string



Q.03F 2

(i) What will the code print?

int arr[] = new int [5];
System.out.println(arr);

(i) 0 (ii) value stored in arr[0] (iii) 0000 (iv) garbage value

(ii) Name the keyword which is used to resolve the conflict between method parameter and instance variables/fields



Q.03G 2

State the package that contains the class :
(i) BufferedReader
(ii) Scanner



Q.03H 2

Write the output of the following code segment:

char ch;
int x = 97;
do {
  ch = (char) x;
  System.out.print(ch + " ");
  if (x % 10 == 0)
    break;
  ++x;
} while (x <= 100);

 



Q.03I 2

Write the Java expression for: a2+b2/2ab



Q.03J 2

If int y = 10 then find int z = (++y * (y++ + 5));



Q.04A 15

Define a class ParkingLot with the following description:
Instance variables/data members:
int vno – To store the vehicle number
int hours – To store the number of hours the vehicle is parked in the parking lot
double bill – To store the bill amount
Member methods:
void input() – To input and store vno and hours
void calculate() – To compute the parking charge at the rate of Rs.3 for the first hour or part thereof, and Rs.1.50 for each additional hour or
part thereof.
void display() – To display the detail
Write a main method to create an object of the class and call the above methods



Q.05A 15

Write two separate programs to generate the following patterns using iteration(loop) statements:
(a)

1 *
2 * #
3 * # *
4 * # * #
5 * # * # *

(b)
[/code]
5 4 3 2 1
5 4 3 2
5 4 3
5 4
5
[/code]



Q.06A 15

Write a program in to input and store all roll numbers, names and marks in 3 subjects of n number of students in five single dimensional
arrays and display the remark based on average marks as given below:
Average marks = total marks/3

AVERAGE MARKS REMARK
85 – 100 EXCELLENT
75 – 84 DISTINCTION
60 – 74 FIRST CLASS
40 – 59 PASS
Less than 40 POOR


Q.07A 15

Design a class to overload a function Joystring() as follows: [15]
(i) void Joystring(String s, char ch1, char ch2) with one string and two character arguments that replaces the character argument ch1 with
the character argument ch2 in the given string s and prints the new string
Example:
Input value of s = “TECHNALAGY”
ch1 = ‘A’
ch2 = ‘O’
Output : “TECHNOLOGY”
(ii) void Joystring(String s) with one string argument that prints the position of the first space and the last space of the given String s.
Example:
Input value of = “Cloud computing means Internet based computing”
First Index : 5
Last Index : 36
(iii) void Joystring(String s1, String s2) with two string arguments that combines the two strings with a space between them and prints the
resultant string
Example :
Input value of s1 = “COMMON WEALTH”
s2 = “GAMES”
Output : “COMMON WEALTH GAMES”
(use library functions)



Q.08A 15

Write a program to input twenty names in an array. Arrange these names in descending order of alphabets , using the bubble sort
technique.



Q.09A 15

Use switch statement,write a menu driven program to:
(i) To find and display all the factors of a number input by the user (including 1 and excluding number itself.)
Example :
Sample Input : n = 15.
Sample Output : 1, 3, 5
(ii) To find and display the factorial of a number input by the user. The factorial of a non-negative integer n ,denoted by n!,is the product of
all integers less than or equal to n.
Example :
Sample Input : n = 5
Sample Output : 120.
For an incorrect choice, an appropriate error message should be displayed.