0% found this document useful (0 votes)
59 views4 pages

Icse 10 2024

The document contains a practice test for a computer science exam. It includes 25 multiple choice questions covering topics like OOPs concepts, Java programming, and algorithms. It also includes 5 programming problems involving classes, arrays, strings, and functions.

Uploaded by

somrupnaskar7403
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)
59 views4 pages

Icse 10 2024

The document contains a practice test for a computer science exam. It includes 25 multiple choice questions covering topics like OOPs concepts, Java programming, and algorithms. It also includes 5 programming problems involving classes, arrays, strings, and functions.

Uploaded by

somrupnaskar7403
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/ 4

FM:100 ICSE computer application Time:2 hours

GROUP-A
1. The concept of Abstraction is
(a) Binding data and functions together
(b) Hiding inner complexity and providing usable interfaces
(c) Reusing of the code
(d) Making methods constant
2. Java supports
(a) Single Inheritance (b) Multilevel Inheritance (c) Multiple Inheritance
(d) Both a and b
3. Code reuse is implemented by :
(a) Abstraction (b) Function overloading (c) Inheritance (d) Polymorphism
4. Which of the following statements are true?
(a) An abstract class may not have any final methods.
(b) A final class may not have any abstract methods.
(c) Transient variables must be static.
(d) All of the above
5. What do you mean by nameless objects?
(a) An object created by using the new keyword.
(b) An object of a superclass created in the subclass.
(c) An object without having any name but having a reference
(d) An object that has no reference.
6.Data hiding is implemented by
(a) Access specifiers (b) Static variables (c) Inheritance (d) None
7.The statement to create an object of class student in Java is :
(a) obj= create Object();(b) obj=new Student();
(c) obj=new object(Student); (d) None of the above

8.……………….. objects of a class can be created


(a) 5
(b) Only 1
(c) As many
(d) 2
9.Which is odd in given options
(a) Inheritance (b) Reusability (c) Base class and Sub class (d) private
10. A class is a ……………….
(a) Primitive data type
(b) User defined data type
(c) User defined derived data type
(d) Derived data type
11. Which of these statements are incorrect?
a) Assignment operators are more efficiently implemented by Java run-time system than their equivalent
long forms
b) Assignment operators run faster than their equivalent long forms
c) Assignment operators can be used only with numeric and character data type
d) None of the mentioned
12.Evaluate the following Java expression, if x=3, y=5, and z=10:
++z + y - y + z + x++
a)24 b)23 c)20 d)25
13.Out of these methods of the String class, which one can be used for testing the strings for
equality?
a. isequals() b. isequal() c. equals() d. equal()
14. Out of these, which one is the correct way of calling a constructor that has no parameters of
the superclass A by the subclass B?
a. superclass.(); b. super(void); c. super(); d. super.A();
15. Out of these methods of the Object class, which one can clone an object?
a. Object clone() b. clone() c. Object copy() d. copy()
16.Out of these packages, which one contains an abstract keyword?
a. Java.util b. Java.lang c. java.system d. Java.io
17.What will be the output of the following code?
int size = 2;
if (size < 0)
System.out.println("Small");
else if (size == 0)
System.out.println("Medium");
else
System.out.println("Large");
a)Small b)Large c)Medium d)Runtime error

18. Out of these methods, which one can be used for converting all the characters present in a
String into an Array of characters?
a. both getChars() & toCharArray()
b. both charAt() & getChars()
c. charAt()
d. all of the mentioned
19.Where does the String Pool get stored?
a. Metaspace
b. Java Stack
c. Java Heap
d. Permanent Generation
20.Out of the following, which one is a superclass of all the exception type classes?
a. String
b. RuntimeExceptions
c. Catchable
d. Throwable
21.The method to determine whether the specified char value is in uppercase or not.
a)toUpperCase(char) b)toLowerCase(char)
c)isLowerCase(char) d)isUpperCase(char)
22.Assertion (A) Method should be called explicitly either with object reference or class reference.
Reason (R) Method can be any user defined name.

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.
23.Evaluate the following expressions, when int a = 8, b = 14.
(a) b/a++ (b) --a + b-- + a
24.Find the value of ++a * (a++ + 5) + 3 * --a, if a = 12.
25.What will be the output of the following code?
int num = 10;
if (num < 20)
System.out.print(num++);
else
System.out.print(--num);
26.Find the output of the given code.
int a, b = 100;
for (a = 10; a <= 12; a++)
{
b += a;
}
System.out.print("a:" + a + " " + "b:" + b);
27.The following code has some error(s). Identify the errors and write the corrected code.
Int x = 4, y = 8;
{
y = y + (x++)
} while (x <= 10)
System.out.println(y);
28.State the method that determines, if the specified character is an uppercase character.
29.Write the return data type of the following functions.
(a) startsWith( ) (b) log( )
30.State the type of errors, if any in the following statements.

a. switch (x < 2)
b. int a = 100, b = 0;

System.out.println (a / b);
GROUP B

1.Design a class name ShowRoom with the following description :


Instance variables/ Data members :
String name – To store the name of the customer
long mobno – To store the mobile number of the customer
double cost – To store the cost of the items purchased
double dis – To store the discount amount
double amount – To store the amount to be paid after discount
Member methods: –
ShowRoom() – default constructor to initialize data members
void input() – To input customer name, mobile number, cost
void calculate() – To calculate discount on the cost of purchased items, based on following criteria

Cost Discount (in percentage)

Less than or equal to ₹ 10000 5%

More than ₹ 10000 and less than or equal to ₹ 20000 10%

More than ₹ 20000 and less than or equal to ₹ 35000 15%

More than ₹ 35000 20%

void display() – To display customer name, mobile number, amount to be paid after discount
Write a main method to create an object of the class and call the above member methods.
2.Write a program to accept name and total marks of N number of students in two single subscript array
name[ ] and totalmarks[ ].
Calculate and print :
(i) The average of the total marks obtained by N number of students.
[average = (sum of total marks of all the students)/N]
(ii) Deviation of each student's total marks with the average.
[deviation = total marks of a student - average]
3.Define a class to accept a number and check whether the number is valid number or not. A valid
number is a number in which the eventual sum of digits of the number is equal to 1.
e.g., 352 = 3 + 5 + 2 = 10 = 1 + 0 = 1
Then 352 is a valid number.
4. Define a class Anagram to accept two words from the user and check whether they are anagram of
each other or not.
An anagram of a word is another word that contains the same characters, only the order of characters is
different.
For example, NOTE and TONE are anagram of each other.
5.Design a class to overload a function series() as follows: [15]
(a) void series (int x, int n) – To display the sum of the series given below:
x1 + x2 + x3 + ……………. xn terms
(b) void series (int p) – To display the following series:
0, 7, 26, 63 p terms.
(c) void series () – To display the sum of the series given below:

You might also like