0% found this document useful (0 votes)
13 views5 pages

Sxcs X Sem1 2021

The document is a test paper for Class 10 Computer Applications at St. Xavier’s Collegiate School, Kolkata, dated 22-09-2021. It consists of multiple-choice questions, fill-in-the-blanks, true/false statements, and programming tasks related to Java concepts. The test is divided into two sections: Section A with 40 marks and Section B with 40 marks, requiring students to answer all questions in Section A and any two from Section B.
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)
13 views5 pages

Sxcs X Sem1 2021

The document is a test paper for Class 10 Computer Applications at St. Xavier’s Collegiate School, Kolkata, dated 22-09-2021. It consists of multiple-choice questions, fill-in-the-blanks, true/false statements, and programming tasks related to Java concepts. The test is divided into two sections: Section A with 40 marks and Section B with 40 marks, requiring students to answer all questions in Section A and any two from Section B.
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/ 5

St.

Xavier’s Collegiate School, Kolkata


First Semester Block Test
Class : 10 Date : 22-09-2021
Subject : Computer Applications Time : 8:00 am – 10:00 am
Full Marks : 80 Uploading Time (Microsoft Teams): 10:00 am – 10:15 am
Instructions:
• Make sure you write your name, class, section, roll no, subject and page no (in advance) on all sheets that
you submit.
• Ensure that the quality of the image/pdf of the answer script submitted is easily readable.
SECTION A (40 Marks)
All questions are compulsory
Question 1
Choose the correct answer [5×1]

a. Which of the following is not a Java primitive type


A) byte B) float
C) character D) long

b. Which of the following is not mandatory in a variable declaration?


A) a semicolon B) an identifier
C) an assignment D) a data type

c. Continue statement can be used


A) anywhere inside the main method B) anywhere inside the class
C) within instance methods D) only within looping statements

d. What is byte code in Java?


A) Code generated by a Java compiler B) Code generated by a Java Virtual Machine
C) Name of Java source code file D) Block of code written inside a class

e. Which variables are created when an object is created with the use of the keyword 'new' and destroyed when the
object is destroyed?
A) Local variables B) Instance variables
C) Class Variables D) Static variables

Question 2
Fill in the blanks with the correct option [5×1]
a. If a variable is declared final, it must include …………………. value.
A) integer B) no
C) initial D) float

b. When the operators have the same priority, they are evaluated from …………….. …………. in the order they appear in
the expression.
A) right to left B) left to right
C) any of the order D) depends on the compiler

c. In Java, …………. can only test for equality, whereas ………… can evaluate any type of Boolean expression.
A) switch, if B) if, switch
C) if, break D) continue, if

d. By using ………………. you can force an immediate termination of a loop, bypassing the conditional expression and
any remaining code in the body of the loop.
A) break B) continue
C) terminate D) end
e. Method overloading is one of the ways that Java supports …………
A) encapsulation B) class
C) inheritance D) polymorphism

Question 3
Name the following [5×1]

a. An interpreter that converts byte code to machine language.


A) JIT B) JVM C) JVG

b. They represent non-graphic characters.


A) keywords B) literals C) escape sequences

c. The process by which an object acquires the properties of another object.


A) Abstraction B) Polymorphism C) Inheritance

d. The name given to the character set of Java.


A) UNICODE B) ASCII C) IISCODE

e. A method having the same name as the class.


A) Function B) Constructor C) Method

Question 4
State True Or False [5×1]

a. Methods can be overloaded with a difference only in the type of the return value.
A) True B) False

b. In Java, a string is a primitive data type.


A) True B) False

c. Each method in a Java class must have a unique name.


A) True B) False

d. Comparisons precede logical operations in Java.


A) True B) False

e. A private method is accessible from inside all classes in the same package.
A) True B) False

Question 5
Choose the odd one [5×1]

a.
A) += B) %= C) == D) /=

b.
A) ‘z’ B) “y” C) x D) 34

c.
A) true B) class C) else D) for

d.
A) literal B) keyword C) identifier D) object

e.
A) byte B) short C) long D) double
Question 6
Give the output of the following [5×1]
a. int a=5,x=50;
while(a<x)
{ x=x/a;
}
System.out.println(x);

A) 5 B) 2 C) 1

b. char c=‘a’;
switch (c)
{
case ‘a’;
System.out.print(“A”);
case ‘b’;
System.out.print(“B”);
default;
System.out.print(“C”);
}

A) A B) AB C) ABC

c. x*=5 + --q * q++ + 10; if x=5 and q=2 before evaluation.


A) 36 B) 80 C) 85

d. char grade=(mark>=90)? ‘A’: (mark>=80)? ‘B’ : ‘C’; if mark=80.


A) A B) B C) C

e. int ctr=1;
for (int i=1 ; i<=5 ; i++)
for(int j=1 ; j<=5 ; j+=2)
++ctr;

A) 15 B) 16 C) 17

Question 7 [5×1]

The following program code checks if the positive integer ‘N’ is a palindrome number by returning true or false.
There are some places in the code marked as ?1?, ?2?, ?3?, ?4? and ?5? which are to be replaced by a
statement/expression so that the code works properly.

boolean Palindrome(int N)
{
int rev = ?1? ;
int num = N;
while (num>0)
{
int f = ?2?;
rev = ?3? + f;
num /= ?4?;
}
if(rev == ?5?)
return true;
else
return false;
}
Answer the following questions:
a. What is the statement or expression at ?1?
(A) -1 (B) 0 (C) 10 (D) 2

b. What is the statement or expression at ?2?


(A) N *10 (B) num/10 (C) num%10 (D) N%10

c. What is the statement or expression at ?3?


(A) num * 10 (B) rev * 10 (C) N * 10 (D) rev

d. What is the statement or expression at ?4?


(A) 10 (B) 100 (C) 2 (D) f

e. What is the statement or expression at? 5?


(A) 1 (B) num (C) N (D) 10

Question 8 [5×1]

The following function computes the quotient and remainder of a division. There are some places in the code
marked as ?1?, ?2?, ?3?, ?4? and ?5? which are to be replaced by a statement/expression so that the code works
properly.

public void quotientrem()


{
int dividend=13,divisor=2,quo=?1?;
int rem;
while(dividend>=?2?)
{
dividend - = ?3?;
quo=?4?;
}
rem=?5?;
}

Answer the following questions:


a. What is the statement or expression at ?1?
(A) 1 (B) 0 (C) divisor (D) dividend

b. What is the statement or expression at ?2?


(A) 0 (B) divisor (C) rem (D) quo

c. What is the statement or expression at ?3?


(A) 0 (B) divisor (C) 10 (D) quo

d. What is the statement or expression at ?4?


(A) quo+1 (B) divisor (C) dividend (D) quo*10

e. What is the statement or expression at ?5?


(A) 1 (B) quo (C) divisor (D) dividend
SECTION B (40 Marks)
Attempt Question 9 and any 2 other questions

Question 9 [10]

Design a class to overload a function volume( ) as follows:


void volume(int s) – To calculate and print the volume of a cube (side3).
void volume(int l,int b,int h) – To calculate and print the volume of a cuboid (length x breadth x height).
void volume(double r) – To calculate and print the volume of a sphere (4/3𝜋𝜋𝑟𝑟 3 ).

Question 10 [15]

Input a sentence and a word. Print the output after excluding that word from the sentence (if found).
A variable description table is to be written.
Sample Input: Rahul has worked very hard. His performance is very good.
Keyword: very
Sample Output: Rahul has worked hard. His performance is good.

Question 11 [15]

Write a program to enter 10 integers each in two different arrays. Find and print if they are mirror images of each
other or not. A variable description table is to be written.

Eg. a[]={1,2,3,4,5,6,7,8,9,10} and b[]={10,9,8,7,6,5,4,3,2,1} are mirror images.

Question 12 [15]

A library issues books on a rental basis at a 2% charge on the cost price of the book per day. As per the rules of the
library, a book can be retained for 7 days without any fine. If the book is returned after 7 days, a fine will be charged
for the excess days as per the chart given below:
Number of excess days Fine per day
1 to 5 2.00
6 to 10 3.00
Above 10 days 5.00
Design a class Library to perform the task. The details of the class is given below:
Class name : Library
Data members
name : name of the book
author : author of the book
p : price of the book in decimals
d : number of days taken in returning the book.
f : to store the fine.

Member functions
Library(…) : parameterized constructor to assign values to data members.
void fine() : calculate the fine for excess days.
void display() : displays the book details along with the number of days, fine and total amount to be paid.
Total amount is calculated as:
(2% of price of book * total no. of days) + fine
Write the main function to create an object and call the methods.
A variable description table need not be written.

You might also like