A Resourceful ICSE computer Application sample paper-2
This paper is divided into two sections. You are to answer all the questions from section A, and any four from section B.
To learn more about string methods click the given link.
String handling in JAVA
This paper is divided into two sections. You are to answer all the questions from section A, and any four from section B.
Section A(40 marks)
Attempt all questions
Question 1.
- What is function overloading? Explain with example.
Name the primitive data type in Java that is:
- A 64 bit integer used when you need a range of values wider than those provided by int.
- A single 16-bit Unicode character whose default value is ‘\u0000’.
Define Polymorphism.
double b=-65.3;
double a= Math.rint(Math.abs(b));
System.out.println(" a = "+ a);
5. What is the difference between a static member functions & function which are not static?
Question 2.
- Write statements for the following To create an object of class Teacher with default constructor. To invoke a method of class Teacher i.e Make_Result(int x)
- What is the difference between a constant and a variable?
- What is a package? Give name of any two packages.
- What do you mean by type conversion? How is implicit conversion different from explicit conversion?
- State the difference between while loop and do while loop.
Question 3.
- What will be the output when the following code segments are executed? String s=”1001”; int x=Integer.valueOf(s);
double y=Double.valueOf(s);
System.out.println(“x=”+x);
System.out.println(“y=”+y); System.out.println(“The king said \” Begin at the beginning ! \” to me.”);
2. Consider the following
Public class Student
{
Public static int x=3,y=4;
Public int a=2,b=3;
}
- Name the variables for which each object of the class will have its own distinct copy..
- Name the variables that are common to all objects of the class. 3. In the program given below, state the name and value of the Method argument or argument variable , class variable, local variable, instance variable
class myClass
{ static int x= 7; int y=2;
public static void main(String args[])
{
myClass obj = new myClass();
System.out.println(x);
obj.sampleMethod(5);
int a=6;
System.out.println(a);
}
void sampleMethod(int n)
{ System.out.println(n);
System.out.println(y);
}
}
4. What will be the result stored in x after evaluating the following expression?
int x=12;
x+=(x++) + 4 + ( --x);
5. Give one example each of a primitive data type and a composite data type.
Question 4.
- * Name the package that contains Scanner class. *Which unit of the class gets called, when the object of the class is created?
2. What is the role of keyword void in declaring functions?
3. What is a token? Name any two of them.
4. What is the data type returned by the library functions:
compareTo(), equals()
5. Write the Java expressions for: A2 + B3
Section B
Attempt any 4 questions from this section. Each program should be written using a variable list so that the logic of the program is clearly depicted.
Question 5.
Write a class fact which takes integer number and check whether it is Automorphic number or not.
An automorphic number is the number which is contained in the last digit(s) of its square.
Example 25 is an automorphic number as its square is 625 and 25 is present as thelast two digits.
- Create a class to take an integer number and check if it is a palindrome number of not.
A palindrome number is a number when reversed also the number remains the same.
Example: 121 is a palindrome number.
Question 6.
Define a class student as described below:
Datamembers/Instance variables:
Name,age,m1, m2,m3 (marks in 3 subjects), maximum, average
Member methods:
- A parameterized constructor to initialize the data members
- To accept the details of a student
- To compute the average and the maximum out of three marks
- To display the name, age, marks in three subjects, maximum and average.
Question 7.
Write a program to input any given string to calculate the total number of characters and vowels
present in the string and also reverse the string.
Example :
INPUT
Enter String : SNOWY
OUTPUT
Total number of characters : O5
Number of Vowels : 01
Reverse string : YWONS
Question 8.
Design a class to overload a function polygon( ) as follows:
i) void polygon(int n, char ch) with one integer argument and one character type argument that draws a filled square of side n using the character stored in ch
ii) void polygon(int x, int y) with two integer arguments that draws a filled rectangle of length x and breadth y, using the symbol @
iii) void polygon() with no argument that draws a filled triangle below.
Example :
Input value of n=2. Ch=’O’
Output:
i) OO
OO
Input value of x=2, y=5
ii)Output:
@@@@@
@@@@@
iii)
Output:
*
**
***
Question 9.
Write a menu driven program to find the sum of the following series depending on the user choosing 1 or 2
- S=1/4+1/8+1/12.........+1/n (value of n will be given by the user)
- S=1/x1+2/x2+3/x3.......+n/xn(value of x and n will be given by the user)
Question 10.
Write a program to input and store any ten numbers given by the user in an integer array. Sort and display them in ascending order using any sorting technique (Bubble sort or selection sort).
For java videos click
https://www.youtube.com/user/trushna.tej
Related Posts
Continue learning with these related articles

User-Defined Methods in Java for ICSE Class 10: Parameters, Return and Overloading
ICSE Class 10 Computer Applications notes on user-defined methods: method prototype and signature, formal and actual parameters, return types, call by value vs call by reference, pure and impure methods, static methods and method overloading, with programs.

String Methods in Java for ICSE Class 10: 25 Output Questions with Answers
ICSE Class 10 Computer Applications practice on String class methods: length, charAt, indexOf, lastIndexOf, substring, replace, trim, compareTo, equals and more, with 25 board-style output questions and step-by-step answers.

Special Number Programs in Java for ICSE: Armstrong, Spy, Neon, Disarium, Pronic and More
Every special number asked in ICSE Computer Applications – prime, perfect, Armstrong, palindrome, automorphic, neon, spy, Niven, duck, buzz, Disarium, special and pronic numbers – with definitions, examples and one complete Java program that checks them all.