Half Yearly Question Paper

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

No.

of Printed Pages : 6
Half Yearly Examination, 2024-25
Computer Applications
Time: 2.00 Hrs. Class - IX M.M.:100

Name ..Abhay. Roll No,..5

Answers to this Paper must be written on the paper provided separately.


Youwill not be allowed towrite during the first 15 minutes.
This time is to be spent in reading the question paper.
The time given at the head of this Paper is the time allowed for writing the
answers.
This Paper is divided into two Sections.
Atfempt all questions fromSection Aand any four questions from Section B.
The intended marks for questions or parts of questions are given in brackets |
Section - (A)
(Attempt ALL questions from this Section.)
Question 1. [20]
Choose the correct answer to the questions from the given options :
(Do not copy the question, write the correct answers only.)
(i) Name the OOP principle that is best depicted in the given picture :
M.S.DHONI

INDIA

BOWLER BATSMAN WICKETKEEPER

(a) Encapsulation (b)Inheritance (c) Abstraction (d) Polymnorphism


CISCE/1/24 PT.0.
Computer Applications 2 |
(ii) The default value of Boolean data
type is :
IX/750
(a) 0 (b) Irue (c) (d) false /
(ii) Name thepackage that containsthe Math class :
(a) java.lang (b) java.util (c) java.io (d) java.awt
(iv) Which of the following is a valid character literal ?
(a) A (b) A (c) a (d) 2"
(v) Which of the following is a ternary operator ?
(a) (b) (c) ?= (d)
(vi) Which one of the following methods terminates a running program ?
(a) System.exit(0 (b) System.stop( 1)
(c) System.quit (0) (d) System.end()
(Vii) The expression which uses *" operator is known as :
(a) boolean (b) assignment (c) arithmetic (d) String
(viii) The statement in a switch construct is optional.
(a) case (b) default (c) switch (d) both (b)and (c)
(ix) Assertion (A) : A keyword cannot be used as an identifier.
Reason (R) Keywords in java are the reserved words that have
a predefined meaning in the language.
(a) Both Assertion (A) and Reason (R)are true and Reason (R) is a correct
explanation ofAssertion (A) e
(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
(x) Assertion (A) : Injava,an objeetofthe Seanner cBass is ereated to
aeeessits-member methods.
Reason (R) Aoobjeetis created to aceess Math ctass methods.
(a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct
explanation of Assertion (A)
CISCE/1/24
A:Logical oPPiator Can be osed to woin
Gne OY more telati on cl operator
R: Logical oferalors arr binatt
Computer Applications IX/750
(b) Both Assertion (A) and Reason (R) are truc and Reason (R) is not a
correct explanation ofAssertion( A)
(c) Assertion (A) is true and Rcason (R) is false
(d) Assertion (A) isfalse andReason (R) is true
(xi) Which of the following is a valid identifier ?
12#abc
(a) labc (b) abc123 (c) ab&12 (d)
(XI1) What type of error is there if asemicolon is missed in astatement?
(a) Terminal error (b) Run time error
(c) Logical error (d) Syntax error >
(xii)What willbe the output of the following code snippet ?
System.out.print( Math.ceil(3. 1) + Math.pow(3,2);:
(a) 13.0 o (b) 12.0 (c) |1.5 (d) 10.5
(xiv) The jump statement in java that terminates the current block when
executed:
(a) break e (b) return (c) continue (d) jump
(xv) Which of the following statements involves a fall through ?
(a) if else (b) nested if (c) ifelse if(ladder) (d) switch case o
(xvi) What is the return type of Math.sqrt() ?
(a) int (b) char (c) double Go (d) float
(xvii) The symbols used for multiline comments in java:
(a) | (b) (c) (d) **
(xvii) The keyword used to include a class in a program :
(a) include (b) import (c) export (d) add
(xix) Identify the type conversion taking place in the following code
snippet :
double x=71.54:
int y = (int) x:
(a) implicit (b) explicit (c) widening (d) broadening
(xx) InPOP, more emphasis is given to :
(a) data (b) object (c) method (d) class

CISCE/1/24
Computer Applications | 4 | IX/750
Question 2.
(i) Name the type of error(syntax, runtime or logicalerror) in each case
given below :
(2|
(a) toperalor used when the operation should bedivision.
(b) Typing INT instead of int for the variable declaration.

(i) Write a java expression for : -b+/b-4ac [2]


2a
(iii) What will be the output of the following statements ? |2]
Systenm.oul.print(°Be patient or");
System.out.println("become a patient");
(iv) Rewrite the following program segment using a ternary operator
instead of if else statement : |2|
int a=2, b-5, x:
if(a>(b)
XFa;

else
x=b:
(v) State the 00P conceptthat is implemented through:
(a) asuper class and a subclass.
(b) the act of representing essential features without including background
details.
(vi) State the output of the following code : (2|
int m= 3:
Int n =m + a-B':
System.out.println("m=*+m +" and n="tn):
(vii) Differentiate between +and tt operators along with an example. (2]
(viii) Write the result for x and y : |2|
double x =Math.abs(Math.min(-1.45,-2.33);
int y =(int) Math.round( Math.ceil(2.34):
CISCE/1/24
Computer Applications IX/750
(ix) State the dillerenee between dyclational opcrator and alogical operator. |2|
(N) What will be the outputof the following code ? |2|
int a= 5. b=9. e:
C=at+ -+tb+ a:
System.out.println("a-" ta):
System.out.println("c="te);
Section - (B)
(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 writen using variable description /mnemonic codes so
that the logic of the program is clearly depicted.
Flowcharts and algorithms are not required.
Question 3. |15|
Write a menu driven program to accept a choice fromn a user and display the result
according to thechoice made.
Choice Result

Area of a rectange
2 Vokune ofacube-3
Area of acirce T
Give an appropriate message if a user enters any other number as his/her
choice.
Question 4. |15]
Write a program in Java to accept two numbers and store them in variables a and b.
Interchange these values wilhout using a third variable and display them.
Example: a=5 and b=7|Original values]
A=7and b=5[Interchangedvalues]
CISCE/1/24
Computer Applications IX/750
Question 5. |15]
Write a program in Java to accept adigit from I to 7and display the name of the
weckday accordingly (using switch stalement).
|Hint : 1for Monday. 2for Tuesday and so on]
Question 6. |15]
An Electricity Board charges for electricity per month from their consumers
according tothe unitsconsumed. The tariffis given below:
Units Cons umed Charges
First 100 units 40 paise per unit
Next 200units 60 paise per unit
above 300 units 1per unit

Write aprogram to calculate the electricity billtaking consumer's name and units
consumed as inputs. Display the output.
Question 7. [15]
Write a program to accept two numbers as input. Find their product anddisplay
whether the product so obtained is an even value or an odd value.
Question 8. [15]
Write a program in javathat identifies and displays whether a given character is an
uppercase character. a lowercase character. adigit or a specialcharacter.

CISCE/1/24

You might also like