ICSE Computer Application - Class X - 2015 PYQ
Table of Content:
- Question 1: What are the default values of the primitive data type int and float?
- Question 2: State the output when 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)); - Question 3: The access specifier that gives the most accessibility is ________ and the least accessibility is ________.
- Question 4:
(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. - Question 5:
(i) What will this code print ?
int arr[]=new int[5]; System.out.println(arr); - 0
- value stored in arr[0]
- 0000
- garbage value
- Question 6: Name the keyword which is used- to resolve the conflict between method parameter and instance variables/fields.
- Question 7:
State the package that contains the class:
- BufferedReader
- Scanner
- Question 8: Write the output of the following program code:
char ch ; int x=97; do { ch=(char)x; System.out.print(ch + " " ); if(x%10 == 0) break; ++x; } while(x<=100); - Question 9:
Write the Java expressions for:
\[ \begin{align} \\ & \frac{a^2 + b^2}{2ab} \end{align} \] - Question 10: What is the function of catch block in exception handling ? Where does it appear in a program ?
- Question 11: State the data type and value of y after the following is executed:
char x='7'; y=Character.isLetter(x); - Question 12: 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); } - Question 13: Name any two OOP’s principles.
- Question 14: What are identifiers ?
- Question 15:
Identify the literals listed below:
(i) 0.5 (ii) 'A' (iii) false (iv) "a"
- Question 16: Name the wrapper classes of char type and boolean type.
- Question 17:
Evaluate the value of n if value of p = 5, q = 19
int n = (q – p) > (p – q) ? (q – p) : (p – q);
- Question 18:
Arrange the following primitive data types in an ascending order of their size:
(i) char (ii) byte (iii) double (iv) int
- Question 19:
What is the value stored in variable res given below:
double res = Math.pow ("345".indexOf('5'), 3);
- Question 20: Name the two types of constructors
- Question 21: If int y = 10 then find int z = (++y * (y++ + 5));
Related Questions
- Assignment 1:
Define a class called 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 the vno and hours.
void calculate() — To compute the parking charge at the rate of ₹3 for the first hour or part thereof, and ₹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.
- Assignment 2:
Write two separate programs to generate the following patterns using iteration (loop) statements:
(a)
*
* #
* # *
* # * #
* # * # *(b)
5 4 3 2 1
5 4 3 2
5 4 3
5 4
5 - Assignment 3:
Write a program to input and store 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:
- Assignment 4:
Design a class to overload a function Joystring( ) as follows:
- Assignment 5: Write a program to input twenty names in an array. Arrange these names in descending order of letters, using the bubble sort technique.
- Assignment 6: Using switch statement, write a menu driven program to: