ICSE Computer Application - Class X - 2013 PYQ
Table of Content:
- Question 1: What is meant by precedence of operators?
- Question 2: State the values stored in the variables str1 and str2:
String s1 = "good"; String s2 = "world matters"; String str1 = s2.substring(5).replace('t', 'n'); String str2 = s1.concat(str1); - Question 3: What does a class encapsulate?
- Question 4: Rewrite the following program segment using the if..else statement:
comm = (sale > 15000)? sale * 5 / 100 : 0; - Question 5: How many times will the following loop execute? What value will be returned?
int x = 2, y = 50; do{ ++x; y -= x++; }while(x <= 10); return y; - Question 6:
What is the data type that the following library functions return?
- isWhitespace(char ch)
- Math.random()
- Question 7: Write a Java expression for: \[ \begin{align} \\ & u t + \frac{1}{2} f t^2 \end{align} \]
- Question 8:
If int n[] = {1, 2, 3, 5, 7, 9, 13, 16}, what are the values of x and y?
x = Math.pow(n[4], n[2]);
y = Math.sqrt(n[5] + n[7]); - Question 9: What is the final value of ctr when the iteration process given below, executes?
int ctr = 0; for(int i = 1; i <= 5; i++) for(int j = 1; j <= 5; j += 2) ++ctr; - Question 10: Write a Java statement to create an object mp4 of class Digital.
- Question 11: What is an exception?
- Question 12: What is a literal?
- Question 13:
State the Java concept that is implemented through:
- a superclass and a subclass.
- the act of representing essential features without including background details.
- Question 14: Give a difference between a constructor and a method.
- Question 15:
What are the types of casting shown by the following examples?
-
double x = 15.2;
int y = (int) x; -
int x = 12;
long y = x;
-
- Question 16: Name any two wrapper classes.
- Question 17: What is the difference between a break statement and a continue statement when they occur in a loop?
- Question 18: Write statements to show how finding the length of a character array char[] differs from finding the length of a String object str.
- Question 19:
Name the Java keyword that:
- indicates that a method has no return type.
- stores the address of the currently-calling object.
- Question 20:
Name the method of Scanner class that:
- is used to input an integer data from the standard input stream.
- is used to input a String data from the standard input stream.
Related Questions
- Assignment 1: Define a class named FruitJuice with the following description:
- Assignment 2: The International Standard Book Number (ISBN) is a unique numeric book identifier which is printed on every book. The ISBN is based upon a 10-digit code.
- Assignment 3:
Write a program that encodes a word into Piglatin. To translate word into Piglatin word, convert the word into uppercase and then place the first vowel of the original word as the start of the new word along with the remaining alphabets. The alphabets present before the vowel being shifted towards the end followed by "AY".
Sample Input 1: London
Output: ONDONLAYSample Input 2: Olympics
Output: OLYMPICSAY - Assignment 4: Write a program to input 10 integer elements in an array and sort them in descending order using bubble sort technique.
- Assignment 5:
Design a class to overload a function series( ) as follows:
- double series(double n) with one double argument and returns the sum of the series.
sum = (1/1) + (1/2) + (1/3) + .......... + (1/n) - double series(double a, double n) with two double arguments and returns the sum of the series.
sum = (1/a2) + (4/a5) + (7/a8) + (10/a11) + .......... to n terms
- double series(double n) with one double argument and returns the sum of the series.
- Assignment 6:
Using the switch statement, write a menu driven program:
- To check and display whether a number input by the user is a composite number or not.
A number is said to be composite, if it has one or more than one factors excluding 1 and the number itself.
Example: 4, 6, 8, 9... - To find the smallest digit of an integer that is input:
Sample input: 6524
Sample output: Smallest digit is 2
For an incorrect choice, an appropriate error message should be displayed.
- To check and display whether a number input by the user is a composite number or not.