0% found this document useful (0 votes)
23 views2 pages

ICSE (Class-X) Test-II

Uploaded by

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

ICSE (Class-X) Test-II

Uploaded by

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

ICSE (Class-X)

Test-II
Full Marks: 50. Time: 1hr.

1. Answer the following questions: 2X10


a) What Name the types of error (syntax, runtime or logical error) in each case given below:
i. Division by a variable that contains a value of zero.
ii. Multiplication operator used when the operation should be division.
iii. Missing semicolon.
b) Give the output of the following:
i. Math.ceil(-12.56)
ii. Math.max(-17, -19)
(a+ b)
c) Write equivalent Java expressions for the following: x=∛
ab
d) Rewrite the following using ternary operator :
if(x%2==0)
System.out.print(“EVEN”);
else
System.out.print(“ODD”);
e) What will be the output of the following code?
int m=2;
int n=15;
for(int i = 1; i<5; i++);
m++; – –n;
System.out.println(“m=” +m);
System.out.println(“n=” +n);
f) Why is a class called an object factory?
g) What does the following mean?
Employee staff = new Employee( );
h) Write the difference between primitive data types and composite data types.
i) Consider the following code and answer the questions that follow:
class Academic
{
int x,y;
void access()
{
int a,b;
Academic student=new Academic();
System.out.println(“Object Created”);
}
}
i. What is the object name of the class?
ii. Name the instance variables used in the class.
iii. Write the name of local variables used in the program.
iv. Give the type of function being used and its name.
j) How do you declare objects? Show with the help of an example.

Page 1 of 2
2. Write a menu driven program to accept a number from the user and check whether it is ‘BUZZ’ number or to
accept any two numbers and print the ‘GCD’ of them.
(a) A BUZZ number is the number which either ends with 7 or divisible by 7.
(b) GCD (Greatest Common Divisor) of two integers is calculated by continued division method.
Divide the larger number by the smaller; the remainder then divides the previous divisor. The process is
repeated till the remainder is zero. The divisor then results the GCD. 15

3. An electronics shop has announced the following seasonal discounts on the purchase of certain items.

Write a program based on the above criteria, to input name, address, amount of purchase and the type of
purchase (L for Laptop and D for Desktop) by a customer. Compute and print the net amount to be paid by a
customer along with his name and address.
(Hint: discount = (discount rate/100)* amount of purchase, Net amount = amount of purchase – discount) 15

Page 2 of 2

You might also like