ICSE Computer Application - Class X - 2016 PYQ
Table of Content:
- Question 1: Define Encapsulation.
- Question 2: What are keywords ? Give an example.
- Question 3: Name any two library packages.
- Question 4:
Name the type of error ( syntax, runtime or logical error) in each case given below:
- Math.sqrt (36 – 45)
- int a;b;c;
- Question 5:
If int x[] = { 4, 3, 7, 8, 9, 10}; what are the values of p and q ?
- p = x.length
- q = x[2] + x[5] * x[1]
- Question 6: State the difference between == operator and equals() method.
- Question 7:
What are the types of casting shown by the following examples:
- char c = (char) 120;
- int x = ‘t’;
- Question 8: Differentiate between formal parameter and actual parameter.
- Question 9:
Write a function prototype of the following:
A function PosChar which takes a string argument and a character argument and returns an integer value. - Question 10: Name any two types of access specifiers.
- Question 11: What is a parameterized constructor ?
- Question 12: Write down java expression for: \[ \begin{align} \\ & T = \sqrt{A^2 + B^2 + C^2} \end{align} \]
- Question 13: Rewrite the following using ternary operator:
if (x%2 == 0) System.out.print("EVEN"); else System.out.print("ODD"); - Question 14:
Give the output of the following string functions:
- "MISSISSIPPI".indexOf('S') + "MISSISSIPPI".lastIndexOf('I')
- "CABLE".compareTo("CADET")
- Question 15:
Give the output of the following Math functions:
- Math.ceil(4.2)
- Math.abs(-4)
- Question 16: Convert the following while loop to the corresponding for loop:
int m = 5, n = 10; while (n>=1) { System.out.println(m*n); n--; } - Question 17: Write one difference between primitive data types and composite data types.
- Question 18:
Analyze the given program segment and answer the following questions:
- Write the output of the program segment.
- How many times does the body of the loop gets executed ?
for(int m = 5; m <= 20; m += 5) { if(m % 3 == 0) break; else if(m % 5 == 0) System.out.println(m); continue; } - Question 19:
Give the output of the following expression:
a+= a++ + ++a + --a + a-- ; when a = 7
- Question 20:
Write the return type of the following library functions:
- isLetterOrDigit(char)
- replace(char, char)
Related Questions
- Assignment 1: Define a class named BookFair with the following description:
- Assignment 2:
Using the switch statement, write a menu driven program for the following:
(i) To print the Floyd’s triangle [Given below]
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15(b) To display the following pattern:
I
I C
I C S
I C S EFor an incorrect option, an appropriate error message should be displayed.
- Assignment 3:
Special words are those words which start and end with the same letter.
Example: EXISTENCE, COMIC, WINDOW
Palindrome words are those words which read the same from left to right and vice-versa.
Example: MALYALAM, MADAM, LEVEL, ROTATOR, CIVIC
All palindromes are special words but all special words are not palindromes.Write a program to accept a word. Check and display whether the word is a palindrome or only a special word or none of them.
- Assignment 4:
Design a class to overload a function sumSeries() as follows:
- Assignment 5:
Write a program to accept a number and check and display whether it is a Niven number or not.
(Niven number is that number which is divisible by its sum of digits.).Example:
Consider the number 126. Sum of its digits is 1 + 2 + 6 = 9 and 126 is divisible by 9. - Assignment 6:
Write a program to initialize the seven Wonders of the World along with their locations in two different arrays. Search for a name of the country input by the user. If found, display the name of the country along with its Wonder, otherwise display "Sorry not found!".
Seven Wonders:
CHICHEN ITZA, CHRIST THE REDEEMER, TAJ MAHAL, GREAT WALL OF CHINA, MACHU PICCHU, PETRA, COLOSSEUMLocations:
MEXICO, BRAZIL, INDIA, CHINA, PERU, JORDAN, ITALYExamples:
Country name: INDIA
Output: TAJ MAHALCountry name: USA
Output: Sorry Not found!