9-Cta Ste Ay 2023-24

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

SOUTH END SCHOOL

Affiliated to CISCE, New Delhi (ICSE)


Affiliation No. WB420
Nalhati, Birbhum
IX
SECOND TERMINAL EXAMINATION YEAR 2023-24

Maximum Marks – 100 Subject – Computer Applications (Theory) Time - 2 Hours

______________________________________________________________________________________________
This paper is divided into two Sections.
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 [20]
Choose the correct answers to the questions from the given options. (Do not copy the question, Write
the correct answer only.)
(i) Name the feature of Java depicted in the following picture.

(a) Data abstraction (b) Polymorphism (c) Inheritance (d) Encapsulation


(ii) The IDE that cannot be used for writing Java programs is:
(a) Eclipse (b) BlueJ (c) Spyder (d) NetBeans

(iii) Identify the character with the highest ASCII value.


(a) ‘Z’ (b) ‘A’ (c) ‘8’ (d) ‘a’
(iv) Which of the following is an invalid integer literal ?
(a) 2,000 (b) 0x231 (c) 0425 (d) Both a and b
(v) A non-primitive data type is:
(a) char (b) int (c) array (d) long
(vi) Which of the following will produce 3.0 if p = 2.9 ?
(a) (double) Math.round(p) (b) Math.ceil(p) (c) Math.rint(p) (d) All of these

Page 1 of 5
(vii) The number of separators or punctuators used in Java programming is:
(a) 7 (b) 8 (c) 9 (d) 10
(viii) Which of the following are legal lines of Java code ?
1. int w = (int) 888.9;
2. byte x = (byte) 100L;
3. long y = (byte) 100;
4. byte z = (byte)120.76;
(a) 1 and 2 (b) 2 and 3 (c) 3 and 4 (d) All of these

(ix) To assign an actual value to a declared variable for the first time is known as:
(a) declaration (b) initialization (c) assignment (d) All of these

(x) The largest possible value that can be stored in a variable of int data type is:
(a) 27 – 1 (b) 215 – 1 (c) 231 – 1 (d) 263 – 1
(xi) Predict the output:
int x = 5, y = 5;
System.out.println(x || y);
(a) 5 (b) true (c) 10 (d) Syntax error

(xii) A loop in programming is also termed as:


(a) Iterative construct (b) Conditional construct (c) Sequential construct (d) Both a and b
(xiii) Which of the following is a selection statement in Java ?
(a) continue (b) if (c) while (d) None of these
(xiv) Assertion (A): Java is a case-sensitive programming language.
Reason (R): It clearly distinguishes between upper-case and lower-case characters.

(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 false and Reason (R) is true
(d) Assertion (A) is true and Reason (R) is false
(xv) Which of the following is a jump statement in Java ?
(a) continue (b) return (c) break (d) All of these
(xvi) Predict the output:
int g = 4;
System.out.print(g++ * g);
(a) 16 (b) 20 (c) 25 (d) 30
(xvii) Go through the following text, and choose the correct answer:
A reverse loop or backward loop is a loop where the value of the loop control variable (assume x) gets
decremented in every iteration. The lowest value of the loop control variable is mentioned in the loop
condition of backward loops.

If we want to print all natural numbers from 10 to 1, then the test expression will be:
(a) x>=10 (b) x<=10 (c) x>=1 (d) x==1 Page 2 of 5
(xviii) ‘7’ + 7 will result in:
(a) 62 (b) 14 (c) 77 (d) Compile-time error
(xix) Assertion (A): Fall through may occur in any branching statement.
Reason (R): The absence of break statement executes the next case block.

(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 false and Reason (R) is true
(d) Assertion (A) is true and Reason (R) is false

(xx) Predict the output of the following statement:


System.out.print(Math.round(24.5) - Math.rint(24.5));
(a) 1 (b) 1.0 (c) 0 (d) 0.0

Question 2
Answer the following questions (working must be shown if required):
(i) What do you understand by initialisation statement in a loop ? [2]
(ii) Write a Java expression for the following mathematical expression: [2]
3 7
c = 𝑥 2 + √2𝑥

(iii) Convert the following for loop into its equivalent while loop: [2]
for(int c=0; c<=5; c++)
System.out.println(c*c);
(iv) What is variable scope ? [2]
(v) Evaluate the following expression when r = 8: [2]

r– – + ++r * r– – + r;
(vi) State two differences between ‘=’ and ‘==’ operators. [2]
(vii) Identify the type of the statements as follows: [2]
(a) Computer laptop = new Computer(); (b) byte bt = 65;
(viii) What is exit-controlled loop ? Give an example. [2]
(ix) State the difference between 1.23 and 1.23f. [2]
(x) Study the following iterative structure and answer the questions with working: [2]
int a = 2;
do
{
System.out.println(a);
if((a==5)
break;
a++;
}
while (a<=10); Page 3 of 5
(a) How many times will the loop get executed ?
(b) What will be the output ?

SECTION B (60 Marks)


(Answer any four questions from this Section.)
The answers in this section should consist of the programs in either BlueJ environment or any
program environment with Java as the base.
Each program should be written using variable description / mnemonic codes so that the logic of the
program is clearly depicted.
Flow-charts and algorithms are not required.

Question 3
Write a menu-driven program using switch-case to perform the following tasks as per a choice entered by
the user: [15]
(i) To accept a number and check if it is a multiple of 7 or not
(ii) To accept a number and print the sum of its digits
(iii) To accept an integer and count the number of factors
Display an error message if the user enters an invalid choice.

Question 4
Write a program to input 10 integers and display the smallest 3-digit number among them. If any 3-digit
number is not entered, display the error message “No 3-digit number is found.” (nested loop must not be
applied here). [15]

Question 5
Write a program to print the first 15 terms of the Pell series. [15]

In Mathematics, the Pell numbers are an infinite sequence of integers. The sequence of Pell numbers starts
with 0 and 1, and then each Pell number is the sum of twice the previous Pell number and the number before
that.
The first few terms of the sequences are: 0, 1, 2, 5, 12, 29, 70,…….
70 = 2 x 29 + 12; Hence, 70 is a Pell number.

Question 6
Write a program to print all 2-digit Harshad numbers. [15]

A ‘Harshad’ number is a natural number that is divisible by the sum of its digits.
Page 4 of 5
Example:
Take a number 48.
Sum of its digits = 4 + 8 = 12 and 48 is divisible by 12.
So, 48 is a Harshad number.

Question 7
Write a program to print the following pattern: [15]
7777777
6666661
5555512
4444123
3331234

Question 8
A courier service company namely ‘Joel Courier Service’ charges on the weight of the parcel to be shipped
as per the following criteria: [15]

Weight (kg) Rate per kg

Up to 2 kg ₹125.50

Next 3 kg ₹150

Next 5 kg ₹170.75

Next 10 kg ₹195.5

Above 20 kg ₹205

Write a program to accept the weight of the parcel to be delivered, calculate the amount to be paid and display
the bill in the following format:

JOEL COURIER SERVICE


Parcel weight: ******
Amount to be paid: *****
---THANK YOU---

***END OF QUESTION PAPER***

Page 5 of 5

You might also like