0% found this document useful (0 votes)
140 views

10 Icse

The document contains a computer application exam paper for class X with two sections. Section A contains 20 multiple choice questions worth 1 mark each and Section B contains 4 long answer questions worth 15 marks each requiring students to write Java programs or code snippets as answers.

Uploaded by

manochasushil82
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
140 views

10 Icse

The document contains a computer application exam paper for class X with two sections. Section A contains 20 multiple choice questions worth 1 mark each and Section B contains 4 long answer questions worth 15 marks each requiring students to write Java programs or code snippets as answers.

Uploaded by

manochasushil82
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Florence Public School

R. T. Nagar, Bangalore
I Prefinal Examination – November 2023
Sub: Computer Application
Class: X [ICSE]
Date: 24-11-23
Time Duration: 2 hours Max Marks: 100

Section A [40 Marks]


(Attempt all questions from this section)
Question 1.
Four alternatives are given for each question. Choose the most appropriate answer: [20 x 1 = 20]

1. The method of Scanner class that accepts a String with space is __________.
a. nextLong() b. next() c. nextString() d. nextLine()
2. Which of the following is not true about constructor
a. It is used to initialize the instance variables.
b. It is usually public.
c. It returns nothing so the return type should be void.
d. It is invoked during instantiation.

3. Assertion(A): The process of having two or more functions with the same name but different signature is
called as function overloading.
Reason(R): function that doesn’t return any value should have return type as void .
a. Both Assertion(A) and Reason(R) are true and Reason(R) is a correct explanation of Assertion(A)
b. Both Assertion(A) and Reason(R) are true and Reason(R) is not a correct explanation of
Assertion(A)
c. Assertion(A) is true and Reason(R) is false.
d. Assertion(A) is false and Reason(R) is true.
4. Math. random( ) returns __________ type of value.
a. int b. double c. long d. boolean
5. The loop in which initialization, condition and updation is grouped together at one place is:
a. while( ) b. do-while( ) c. for( ) d. None

6. Keyword used to create a variable of composite datatype:


a. class b. new c. return d. instance

7. Assertion(A): Array is also called as subscripted variable.


Reason(R): Each value of an array can be accessed using its index position
a. Both Assertion(A) and Reason(R) are true and Reason(R) is a correct explanation of Assertion(A)
b. Both Assertion(A) and Reason(R) are true and Reason(R) is not a correct explanation of Assertion(A)
c. Assertion(A) is true and Reason(R) is false.
d. Assertion(A) is false and Reason(R) is true

8. Which of the following statements is true about instance variable?


a. Each object has its own copy of these variables.
b. Once the value is changed in any object it gets affected to all the objects.
c. They are declared with the keyword static.
d. They can be accessed in the static functions only.

9. String method used to check if one string is greater than the other string:
a. trim() b. compareTo() c. equals( ) d. greaterThan()

10. Return type of replace() method is:


a. int b. char c. boolean d. String

11. Mention the type of error in the below given code:


for(int i=0, i<=10, i++)
System.out.println(i+”,”);
a. Syntax error b. Runtime error c. Logical error d. None

12. The statement used to get number of elements in an array arr is :


a. arr.size() b. arr.length c. arr.length() d. arr.size

13. The following array reserves ___________ bytes of memory.


short a[]=new short[20];
a. 20 b. 40 c. 80 d. 160

14. To initialize an array, the elements are given within ____________


a. ( ) b. { } c. [ ] d. < >

15. isUpperCase() method is present in ___________ package.


a. java.io b. java.util c. java.lang d. java. awt

16. Math.pow() returns ____________ value.


a. int b. long c. double d. short

17. The method that doesn’t change state of an object is called as ___________
a. Pure method b. impure method c. mutator d. both b. and c.

18. Invoking a function by passing the object as parameter is called as _________.


a. Call by value b. Call by reference c. Call by method d. Function overloading
19. The result of Math.abs(Math.floor(-98.7)) is _______________
a. 98.0 b. 99.0 c. -98.7 d. 98.7
20. Keyword used to create a variable of an array is ____________
a. New b. new c. array d. newarray

Question 2
Do as directed

1. Observe the following code and answer the given questions: [5]
class cuboid
{
int len, bre, height;
double vol;
static String shape;
void input( )
{ ----
}
void calculate()
{ int a=len*bre;
}
void display()
{ ---
}
public static void main()
{
cuboid box= new cuboid();
}
}
a. Mention the class and instance name
b. Name the instance variables and instance methods.
c. Name the class variables and class methods.
d. Name the local variable/s.
e. Write default constructor for the above class.

2. Specify the memory reserved for the following in bytes [2]


a. String s=”You can do it”;
b. long a[]=new long[35];

3. Write the output for the following [4]


a. int a[]={24, 30, 63, 70, 19, 84};
System.out.println(a[0]+a[1] == a[5]);
System.out.println(++a[2] + --a[4]);

b. String s[]={“best”, “excellent”, “perfect”, “batch”};


System.out.println(s.length + s[2].length());
System.out.println(s[0] + s[3]);

4. Mention how many times the loop is going to execute and also mention its output [2]
for(int i=5; i<=50; i+=5)
{
if(i/10==1)
continue;
System.out.print(i+“, ”);
}
5. Mention the java keyword used to perform the following [2]
a. To execute the block of statement when the condition given in front of if( ) is false.
b. Jump statement that returns the control back to the call of function.

6. Write the output for the following [4]


a. System.out.println(Math.abs(Math.ceil(-3.8) + Math.round(2.3)));
b. System.out.println(Math.sqrt(18.3 + 6.7));
c. System.out.println(“Basic”.compareTo(“BACK”));
d. System.out.println(“Excellence”.lastIndexOf(‘c’));

7. “Arrays are also called as subscript variable” elaborate it. [1]

Section B [60 Marks]


(Answer any 4 questions – Each question carries 15 marks)
Each program should be written using variable description

Question 5 [15]
Design a class Employee with the following descriptions.
Instance Variables:
String name – to store the name of the employee
int age – to store age of the employee
double basic_sal – to store basic salary of the employee
double DA – to store Dearness Allowances
double HRA – to store House rent Allowance
double PF – to store Provident Fund
double Net_Sal - to store Net Salary
Instance Methods:
Employee() - default constructor to initialize the instance variables with default values.
void accept() - to input values for name, age and basic salary.
void calculate() - to calculate DA(15% of basic_sal),
HRA(10% of basic_sal), PF(9.5% of basic_sal)
Net_Sal = basic_sal+DA+HRA-PF
If the age is greater than 45 additional Rs.20000 to be added to Net_Sal as Diwali Bonus,
else 12000 to be added to Net_Sal.
void display() - to display the details
Write a main method to create an object and invoke the above methods.

Question 6 [15]
Write a program to input a string and perform as given below:
a. Convert it to upper case.
b. Count and display number of special characters in the string.
c. Display all the starting characters of each word.
Sample Input: Nothing is impossible, the word itself says ‘I’m possible’!
Output: Number of special characters = 5
NIITWISIP

Question 7 [15]
Create a class to overload the function check( ) as given below:
1. boolean check(int n) - checks and returns true if the number is abundant number, else returns false.
[Abundant - The sum of factors of the number excluding itself is greater than the
number]
Ex: if n=12, factors→ 1,2, 3, 4, 6 → 1+2+3+4+6 → 16>12 hence 12 is abundant number.
2. boolean check(String s , char c) – checks and returns true if the character c is present in the string
else returns false.
3. boolean check(char c) – checks and returns true if the character is a special character else returns
false.

Question 8 [15]
Write a program to input 30 students marks into an array, find and display the statistics as given below:
No. of Students securing I class (60 – 100) : ___________
No. of Students securing II class(50 – 59) : ___________
No. of Students securing Pass class(35 – 49) : ____________
No. of Students detained(<35) : _____________

Question 9 [15]
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. The ISBN is legal if:

1 × digit1 + 2 × digit2 + 3 × digit3 + 4 × digit4 + 5 × digit5 + 6 × digit6 + 7 × digit7 + 8 × digit8 + 9 × digit9 +


10 × digit10 is divisible by 11.
Example : For an ISBN 1401601499
Sum = 1×1 + 2×4 +3×0 + 4×1 + 5×6 + 6×0 + 7×1 + 8×4 + 9×9 + 10×9 = 253 which is divisible by 11.

Write a program to :
(i) Input the ISBN code as a 10-digit integer.
(ii) If the ISBN is not a 10-digit integer, output the message, “Illegal ISBN” and terminate the program.
(iii) If the number is 10-digit, extract the digits of the number and compute the sum as explained above.
If the sum is divisible by 11, output the message, “Legal ISBN”. If the sum is not divisible by 11, output the
message, “Illegal ISBN”.
[Note: int data type can store upto 9 digit numbers, so go for higher integer data type ]

Question 10 [15]
Write a program to input 35 students marks into an array. Find and display the highest score and the lowest
score.

You might also like