COMPUTER APPLICATION
(Two hours)
Summative Assessment – 1, 2024-25
Grade: X Max Marks: 100
Answers to this Paper must be written on the paper provided separately.
You will not be allowed to write during the first 15 minutes.
This time is to be spent in reading the Question Paper.
The time given at the head of this Paper is the time allowed for writing the
answers.
_____________________________________________________________________
Attempt all questions from Section A and any four questions from Section B.
The intended marks for questions or parts of questions are given in brackets [ ].
____________________________________________________________________
SECTION A (40 Marks)
(Attempt all questions from this Section)
Question 1 : Multiple Choice Questions [20]
(i) Which property of OOP is depicted through pictures below?
A crane A crane
a) polymorphism b) inheritance
c) encapsulation d) abstraction
(ii) The memory space occupied by constant 103 is…….
a) 32 bits b) 46 bits
c) 4 bits d) 18 bits
(iii) The wrapper class for int datatype is……
a) INTEGER b) Int
c) Integer d) INT
(iv) What will be the output of the code below?
int Integer=24;
char String='I';
System.out.print(Integer);
ICSE This Paper Consists of 8 Printed Pages
System.out.print(String);
a) Compiler Error b) Runtime Error
c) 24I d) 24
I
(v) What will be the output of the following code?
String A="125";
double B=25.25;
int X=Integer.parseInt(A);
String Y=Double.toString(B);
System.out.println(X+Y.length());
a) 1255 b) 150.25
c) 130 d) 12525.25
(vi) …… package is imported by default in a java program.
a) util b) lang
c) Math d) String
(vii) Assertion (A): A java expression can have multiple operations.
Reason (R): The operations in an expression are evaluated according to their
set hierarchy.
a) Both Assertion (A) and Reason (R) b) Both Assertion (A) and Reason
are true and (R) is correct explanation (R) are true and (R) is not correct
of (A) explanation of (A)
c) Assertion (A) is true but reason (R) d) Assertion (A) is false but reason
is false (R) is true
(viii) Which of the following is not considered as distinguishing factor for
overloaded methods?
a) number of parameters b) order of parameters
c) type of parameters d) return type
(ix) Which of the following is method prototype of method grade( ) which accepts
two integer parameters and returns ‘P’ or ‘F’ values?
a) public void grade(int,int) b) public int grade(int,int)
c) public int grade(a,b) d) public char grade(int a, int b)
(x) A method that returns a character after converting it to uppercase.
a) char.toUpperCase(‘a’) b) char.ToupperCase(‘a’)
c) Character.toUpperCase(‘a’) d) character.touppercase(‘a’)
ICSE 2
(xi) Assertion (A): An array can hold values of multiple datatypes.
Reason (R): An array can store multiple values under single name.
a) Both Assertion (A) and Reason (R) b) Both Assertion (A) and Reason
are true and (R) is correct explanation (R) are true and (R) is not correct
of (A). explanation of (A).
c) Assertion (A) is true but reason (R) d) Assertion (A) is false but reason
is false. (R) is true.
(xii) What will be the output of the following?
System.out.println("Beautiful".substring(0,4));
a) iful b) Bea
c) Beau d) ful
(xiii) What are first and last index numbers of following array?
int arr[ ] = {2, 5, 7, 10, 15, 20, 29, 30, 46, 50};
a) 2 - 50 b) 0 - 9
c) 1 – 10 d) cannot say
(xiv) Which of the following statement will find length of a single dimensional
array Arr[ ]?
a) Arr.length( ) b) Arr[ ].length
c) Arr.length d) Arr[i].length
(xv) Name a string function which removes the blank spaces provided in the prefix
and suffix of a string.
a) remove( ) b) Trim( )
c) Remove( ) d) trim( )
(xvi) Sam executes the following program segment and the answer displayed is
zero irrespective of any non-zero values are given. Name the type error.
void triangle(double b, double h)
{ double a;
a = 1/2 * b * h;
System.out.println("Area=" + a);
}
a) Syntax error b) System error
c) Logical error d) There is no error
ICSE 3
(xvii) Which of the following datatype is not valid to use in a switch statement?
a) double b) int
c) char d) String
(xviii) Assertion (A) : A java library has collection of predefined classes.
Reason (R): Charcter.isWhitespace( ) is a method from library classes.
a) Both Assertion (A) and Reason (R) b) Both Assertion (A) and Reason
are true and (R) is correct explanation (R) are true and (R) is not correct
of (A). explanation of (A).
c) Assertion (A) is true but reason (R) d) Assertion (A) is false but reason
is false. (R) is true.
(xix) What will be the result of following string comparison?
String A="Nation";
String B="National";
System.out.println(A.compareTo(B));
a) 2 b) -2
c) 0 d) false
(xx) What is the correct java expression for the following mathematical statement?
a) Math.sqrt(3*x +x*x)/(a+b) b) Math.pow(3x, x*x)/(a+b)
c) Math,sqrt(3x + x*x)/ a+b d) x*x*x + x*x /(a+b)
Question 2: Answer the following.
(i) Give the output of the following code and state how many times the loop is [2]
executed?
for(i=10;i>10;i++)
System.out.println(i++);
System.out.println(“i=”+ i);
(ii) Write syntax of method signature and give an example. [2]
(iii) Evaluate the expression: [2]
int x=5,y=2;
x -= x++ * y % --y + x++;
ICSE 4
(iv) Differentiate between Autoboxing and Unboxing with the help of an example. [2]
(v) What is the output of the following code? [2]
String str={"Apple","Banana","Cherry","Dragon Fruit"};
System.out.println(str.length);
System.out.println(str[3].length());
(vi) Rewrite the following code using ternary operator. [2]
if( var==1)
System.out.println("good");
else if(var==2)
System.out.println("better");
else if(var==3)
System.out.println("best");
else
System.out.println("invalid")
(vii) How is linear search different than binary search? [2]
(viii) Explain why pass by value methods are known as pure methods? [2]
(ix) public class Methods [2]
{ public void exchange(int x,int y)
{ int temp= x;
x=y;
y=temp; }
public static void main(String args[ ])
{ Methods M = new Methods( );
int p=23, q=1;
M.exchange(a,b);
}
}
List actual parameters and formal parameters used in the above program.
(xx) Give one example of each finding length of an array and finding length of a [2]
String.
ICSE 5
SECTION B (60 Marks)
(Attempt any four questions from this Section)
Question 3 [15]
Write a program to input a number as a String, convert and assign the inputted String
value to appropriate numeric datatype of choice int, long, float, double according to
the input String length.
(Hint: assume int can have 5 digits. float can have upto 6 places after decimal point)
Sample input: "516.24"
Sample output: The appropriate datatype is float
float value = 516.24
Question 4 [15]
Write a program to accept an email address and check if it is a valid email address by
testing the following conditions
i) An email must have only one ‘@’ character
ii) An email must have a few characters before @ sign
If it is a valid email ID, print the service provider name and the domain extension.
Sample input #1: “[email protected]”
Output #1: [email protected] is a valid email address.
The service provider: hotmail
Domain extension: .com
Sample input #2: “@lookout.in”
Output#2: Invalid email address
Question 5 [15]
Write a program to accept 10 values in a String array country[ ]. Sort these Country
names in alphabetical order A-Z using bubble sort technique. Print the sorted array.
Sample input: India Brazil Argentina China Belgium Japan France Greece Lebanon
Sample output: Argentina Belgium Brazil China France Greece India Japan Lebanon
ICSE 6
Question 6 [15]
Write a program to accept integer values in a two-dimensional array of size
3 X 4. Find and print minimum even value and maximum odd value in the array. Also
print the DDA in following format.
Sample values and output format: 67 34 10 20
44 81 52 9
21 37 13 7
The minimum even value: 10
The maximum odd value: 81
Question 7 [15]
Declare following methods in one single program. Write a main( ) method to call the
specified methods.
i) boolean techNumber(int num) method accepts a four digit numeric value and
retruns true if the number is tech number else it returns false.
A tech number is split in two equal halves, the square of the sum of these halves is
equal to the number itself
Sample input : 3025 = (30+25) 2 = 3025
Sample ouput: 3025 is a tech number
ii) void pattern(String s) method accepts a String value s and prints a pattern as given
below
When s= “BLUEJ”
Sample output:
B
LL
UUU
EEEE
JJJJJ
ICSE 7
Question 8 [15]
A library charges fine of returning the books late, the fines mentioned are as under:
Number of days delayed Fine amount
First 5 days Rs. 10 per day per book
6 to 10 days Fine of first 5 days plus Rs. 15 per
day per book from the sixth day
More than 10 days Fine of first 10 days plus Rs. 20
per day per book from 11th day
Write a program to accept the number of books taken and no. of days delayed from
the user. If no. of days delayed is 0 or less than 0, it should display “No FINE”.
Sample Output:
Enter number of books taken: 2
Enter number of days delayed: 7
Fine amount to be paid: Rs. 160
ICSE 8