ICSE Computer Application - Class X - 2017 PYQ
Table of Content:
- Question 1: What is inheritance?
- Question 2:
Name the operators listed below:
- <
- ++
- &&
- ? :
- Question 3: State the number of bytes occupied by char and int data types.
- Question 4: What is the difference between
/
and%
operator? - Question 5: Write one difference between / and % operator.
- Question 6:
String x[] = {"SAMSUNG", "NOKIA", "SONY", "MICROMAX", "BLACKBERRY"};
Give the output of the following statements:
- System.out.println(x[1]);
- System.out.println(x[3].length());
- Question 7:
Name the following:
- A keyword used to call a package in the program.
- Any one reference data type.
- Question 8: What are the two ways of invoking functions?
- Question 9: What are the two ways of invoking functions?
- Question 10: State the data type and value of res after the following is executed:
char ch='t'; res= Character.toUpperCase(ch); - Question 11: Give the output of the following program segment and also mention the number of times the loop is executed:
int a,b; for (a = 6, b = 4; a <= 24; a = a + 6) { if (a%b == 0) break; } System.out.println(a); - Question 12: Write a Java expression for the following:
- Question 13: What is the value of x1 if x=5?
x1= ++x – x++ + --x - Question 14: Why is an object called an instance of a class?
- Question 15: Why is an object called an instance of a class?
- Question 16: Convert following do-while loop into for loop.
int i = 1; int d = 5; do { d=d*2; System.out.println(d); i++ ; } while ( i<=5); - Question 17: Differentiate between constructor and function.
- Question 18: Write the output for the following:
String s="Today is Test"; System.out.println(s.indexOf('T')); System.out.println(s.substring(0,7) + " " +"Holiday"); - Question 19:
What are the values stored in variables r1 and r2:
- double r1 = Math.abs(Math.min(-2.83, -5.83));
- double r2 = Math.sqrt(Math.floor(16.3));
- Question 20: Give the output of the following code:
String A ="26", B="100"; String D=A+B+"200"; int x= Integer.parseInt(A); int y = Integer.parseInt(B); int d = x+y; System.out.println("Result 1 = " + D); System.out.println("Result 2 = " + d); - Question 21:
Analyze the given program segment and answer the following questions:
for(int i=3;i<=4;i++ ) { for(int j=2;j<i;j++ ) { System.out.print("" ); } System.out.println("WIN" ); } - How many times does the inner loop execute?
- Write the output of the program segment.
- Question 22: What is the difference between the Scanner class functions next() and nextLine()?
- Question 23: Write the output:
char ch = 'F'; int m = ch; m=m+5; System.out.println(m + " " + ch);
Related Questions
- Assignment 1: Define a class ElectricBill with the following specifications:
- Assignment 2:
Write a program to accept a number and check and display whether it is a spy number or not. (A number is spy if the sum of its digits equals the product of its digits.)
Example: consider the number 1124.
Sum of the digits = 1 + 1 + 2 + 4 = 8
Product of the digits = 1 x 1 x 2 x 4 = 8 - Assignment 3:
Using switch statement, write a menu driven program for the following:
- To find and display the sum of the series given below:
S = x1 - x2 + x3 - x4 + x5 .......... - x20
(where x = 2) - To display the following series:
1 11 111 1111 11111
For an incorrect option, an appropriate error message should be displayed.
- To find and display the sum of the series given below:
- Assignment 4:
Write a program to input integer elements into an array of size 20 and perform the following operations:
- Display largest number from the array.
- Display smallest number from the array.
- Display sum of all the elements of the array
- Assignment 5: Design a class to overload a function check( ) as follows:
- Assignment 6: Write a program to input forty words in an array. Arrange these words in descending order of alphabets, using selection sort technique. Print the sorted array.