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

Full Year Computer

The document is a unit test for Class 10 Computer Application at The Assembly of God Church School, covering various programming concepts and Java programming questions. It includes multiple-choice questions, programming tasks, and theoretical questions related to object-oriented programming, arrays, and methods. The test is structured into two sections, with Section A being compulsory and Section B allowing students to choose questions.

Uploaded by

adilayan2009
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 views10 pages

Full Year Computer

The document is a unit test for Class 10 Computer Application at The Assembly of God Church School, covering various programming concepts and Java programming questions. It includes multiple-choice questions, programming tasks, and theoretical questions related to object-oriented programming, arrays, and methods. The test is structured into two sections, with Section A being compulsory and Section B allowing students to choose questions.

Uploaded by

adilayan2009
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/ 10

Page 1 of Z

The Assembly of God Church School


123/1Frl Stre, Kal 3
Unit Test-2024-25
Computer Application Date:I3-7. 24
Cass: 10 FullMarks :40
Time lHr

Section A(Compulsory)( 10 marks)


and the answer.
guestions from the given options. Write both the option
RVChoose the comect answers to the (10x 1-101

Which test expressioh in the xpressioris syntactically incorrect" d) while (>8)


) whilei5) b) whileti0) c) while(i-|12)

What willbe the value of k. given that doublek92


b) 40 c1. 45

D The keyword that eauses the control o fransfer tack to the caller of unethodis
return 5) vod c) pass by valuc d) pass by reference
1uy Tie dethalt value of boolean is:
b) true ) False ) false

What will be th valus of m.gven that m Math.ccil ( Math.min (22.8,d).


28,2))
28.0
a) 230 b). 29.0 c). 22.0

Wiat wlbe the oulhut, given that


fortint j=2, j<e6; +*)
continuc
System.out.print (}

6 b)7 C)23456 dj234567

The ScasmsTelass metiodused toaccept words with space:


b) Next () c) rexiLine() d) nextString )
y Misinga sericolon in a statement is wat type of eror?
Logcal o)Syrtax c)Runtim d) Noerror

81f the valuc of basic j500, *hat will be the value of variable Tar aftet ihe following statement is executed?
Tax =tasic >1200 ? 200: 100
8) 1200 b) 200 c) 100 d) None of thesc
Given the statenent
What is the eqivalerntstatenent
b). pqi d) syntax error
Assertion(A) Java is platform independent.
Irascn(R Java is compilcd to a bytecode that can run on any machine having JVM.
a) Both Asscrtion (A)and Reason (R)are truc and Reason (R) is a
Both Assert:on (A) and Reasan (R) are true and Reason (R) is notcorrect cxplanation of Asscrtion (A)
a correct explanation of Assertion(A)
Assct;on (A) Is true and Reason (R) Is false

PTO
Page 2 of 2
d) Assertion (A) is false and Reuson (R) is true

Sectlon B(Any two) (30 marks)


[15]
Question 2: given nunber
ofthc niumber is cqualtothe
Anumberis said to be a Neon number ifthc sum ofthe digiis of thesquare
itsclt.
a Neon
Eg: 99x9 -81 > 841-9 u given nunber is
Wite a program to create a method int fh IsNeon(int n) which checks whether1clse rcturm 0.
return
number or not. In case the given number is a Neon numbcr then the method will using an objcct
call the above said method by
e ne man() method to input the number and
[15]
Qrsion 3: given thc following:
Befine a class namcd ARK to overload a method number)
nwm
void number (int num): displays the product of the first and last digit of
void number (double a): displays thc sum of the following serics:
S=1+a3 + a/6+ a/9 +...a21

[15]
Qystion 4:
Besign a class called STORE with the following description:
Class Name : STORE

Instance Variables / Member Data


Int cust num - stores the customer number

double amt - stores the amount of purchase made


double vat - stores the value added tax amount which is 7% of the purchase amount

Member Methods
i. vOid fnlnput () Toinput the customer number, puchase amount,
ii. void fnCalculate ()- Tocalculate the value added tax amount and modify the purchase amount by
the tax loit
iü. void fnDisplay( ) - To display all the member data with proper outputstatements.
iv. void main () - To crcate an object of the class and call the member methods accordingly

--X-
Mondbodeer
Page 1 of 4

THE ASSEMBLY OF GOD CHURCH SCHOOL


125/1, Pek Stret, Kol 17
Half YearlyExamination- 2024-25
Class: 10 Computer Application
Time: 2 Hr [+15 min reading Date : 20,9.24
time) Full Marks: 100

Section A[40Marks) Allquestions are compulsory)


Question 1: Choose the corect answer and write the
i)A set of instructions correct option along with its content: [20x1-20|
enclosed in braces is called:
a)group b) block c) multiple statement d) stack
i) Name the OOP
principle depicted: Spesk

Ousck Woof

Mo

a) Polymorphism b) Inheritance o) Encapsulation d) Abstraction


iün) The array declaration for base type
double with 3 rows and 5 columns is :
a) double ar]= new double
[15]; b) double ar[]-new Double(5][3|:
) double ar[]=new double[3][(5];
d) double arl]-new double(5][31;
iv) Class is
-a) conceptual b) template c) declared once d) all of the above
v) The type of error in the statement: double
q=s/0; is
a) Runtime b) Logical - c) Syntax d) No error
vi)The constant *, will occupy:
a) 4 bytes b) 2 bytes c) 16bits d) both (b) and (°)
vii) Each element of an array is compared with a
given value of same base type, to be searched for one by
a) Sequential Search b) Binary search c) Linear
one:
search d) Both (a) and (c)
viii) What will be the output of:
int arr [] =(7, 9, 19, 45, 50, 66 );
System.out.println (arr.length + "tSum="+ (arr(2) +arr(4) +arr(0] ) ):
-a)6 Sum=76 b) 5 Sum-76 c) 6 Sum:61 d) 6 sum: 61
ix) Assertion: Aclass is a composite data type,
Reason: Aclass encapsulates various
primitive data types such as int, double,char, etc. as a single unit.
a) Both Assertion (A) and Reason (R) are
true and Reason (R) is a correct
b) Both Assertion (A) and Reason (R) are explanation of Assertion (A)
true and Reason (R) is not a correct
c) Assertion (A) is true and explanation of Assertion(A)
Reason (R) is false
d) Assertion (A) is false and
Reason (R) is true
Page 2 of 4

x) Java has .......primitive data types:


a) 7 b) 8 c) 1 d) 2

xi) If p=6.9; then the data type of p is expected to be d) short


a) int b) float c) long

xii) An aray is declared by specifying:


a) its base type b) its name
c) its size d) Al ofoftthem
xiil) is mainly used to initialize values to instance variables. d) object
a) method b) constructor c) class

xiv) What is the return typc of a constructor? d) No return type


a) int b) double c) void

parameters:
xv) In any changes in the formal paranmeters is not reflected back to actual
c) Both (a) and (b) d) None
a) pass by value b) call by reference

xvi) Given double x=Math.ceil(Math.abs(-7.3); What is the final value stored in variable x?
a)7.0 b)8.0 c)6.0 d)9.0

Assertion(A): The statement System.out.print (5 ==9); will cause a Boolean output.


xvii)
Reason(R): Result of acondition is of'String' data type
a) Both Assertion (A)and Reason (R)are truc 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 corect explanation of Assertion(A)
c) Assertion (A) is true and Reason (R) is false
d) Assertion (A) is false and Reason (R) is true
xviii) The output of the given code: int a=10, b=15;
while(++a <--b)
System.out.print (b+"");
System.out.print (a );
a) 13 13 14 b) 14 14 13 c) 14 13 13 d) error

xix) The formal parameters of a constructor are used to initialize the


a) Local variables b) Instance variablès c) Both d) None

Xx) Given int n = B'; What will be the value of n'?


a) B b) 98 c) 66 d) Syntax error

Question 2: Answer the following (2x10-20]


i. Convert the following while loop code to its corresponding for loop code:
int m=5,n=10;
while (n >= 1) {
Systen.out.printin(m*n);
n--;

ii Given the numbers : 64,25, 92,48


If Bubble Sort is applied for arranging them in ascending order, what willit become after the first round?
iii. What is meant by an infinite loop? Give an example.
Computer Apicaan

Page 3 of4

Write one difference between linear and binary search.

V Write two properties of aconstructor.


If n0, give feasoti
Vi. Is the given code correct ? If yes, write the output.
for (int p= 10;p' 1;p-p+4)
System.out.,print (" *+p);

?
vi. What is an objcct and what is a class
viii. Write the output of thc given code: 2,3, 5) );
int arr[ j[] =((3, 9, 10, 20), (1,arr[Lj31):
System.out.printin ( arr[0|2] +

illustrates
ix Write the 0OP feature that
a) Two methods having same name
members of another class
b) One class getting access to certain

X. Evaluate the following and find the value in y:


yt=y- + -y +12; when int y-&

Section B [15x4 = 60marks |


program in Javafor the folowing
Attempt any four programsfrom this section. Write aGive comments wherver picabe
Also write variable description tablefor each program.
Question 3.
Define a class HotelBill as below:

Data Members:

String cust name : Customer's name


number of days the customer will stay in the hotel
int no_ofdays :
double bill: the bill amount

Member Methods:
default constructor to initialize data members
HotelBill( ):
void faTakelnput( ): to accept the customer's name and number of days of stay
void fnCompute( ): to calculate the bill amount as per the given condition
void fnDisplay( ): to display the name and the bill amount
Write amain () method to declare an object ofthe class HotelBill and call the above said mos

No. of days Rate per day


First 5days Rs.1500

Next 10 days Rs.1200


Above 15 days Rs.1000
Page 4 of 4

Question 4. Create athird array


type int and size8 and fill them with variables,
1, both of
Create two arrays P)] and Q smaller clement. Finally, print all the arrays.
N[] that containsthe corresponding
For example :
Input :P[) 97 54 36 87 44 92 28 29
37
Input : Q[] 72 94 44 33 77 87 17
29
Output : N[] 72 54 36 33 44 87 17

Question 5.
Design a class to overload a method Series ) given that
numbers.
(a) long Series (int n) Returns the product of first n even natural
* 4 *6*8*10)
For example, ifn =5then (2
sum of natural numbers from nl to n2 13 + 14 + 15)
(b) long Series (int nl, int n2) Returns the (10+ 11 + 12+
Assuming nl= 10, n2 = |5 then methods.
method to call the two overloaded
Writc the above methods and the main )

Bubble Sort
Question 6.
fill it with variables. Sort it in ascending order using
size 8 and
Create an array CW[ ]of type int and
technique.
For example : 21 76 103
33 87 35 8 483
Input : 483
Output : 8 21 33 35 76 87 103

Question 7. input. Print the elements of the


ADUJof order mxn, by taking the order as
Declare a Double Dimensional Array
sum of all the elements.
array in matrix form. Also print the
For example : m=2;n=3
AD[][] = 67 4
9 3 6
Sum of all elements: 35

Question 8.
and print accordingly. Apply a method for Prime
Input anumber in N. Verify whether it is Prime or not
verification, as given -
boolean fnlsPrime(int N)
17
Anumber is called Prime, if it has only 2 factors.For example:

--X
Mondodecp Geh.a.

Page 1 f 4

CHURCH SCHO0L
ASSEMBLY OF GOD
THE 1381, Pal Strect
ket 12
2024-25
Half Yearly Exanination
Computer Application Date
FullMarks : 100
Class. 10
Time 2Hr ( 15min reading time] compulsory )
A140 Marksl rAll questions are
Section |20x1-20|
correct option along wilh its content:
the
comectansler gnd write
Question l:Choose the most applicabie OOP concept
and choose the
Observe the given image is
Pride Rock Territory'
Mufosa, the king of cousin
conspired byScar, his
killed ina plan blamed and sent away.
Mufasa's son Simba is back his
grows up, he wins
Later when Simba
MUCASA grows it further.
father's kingdom and
SIMBA

(c) Polymophism (d) Abstraction


(a) Encapsulation vb) Inheritance

Find the odd one out :


Ve) toUpperCasct ) (d) floor )
(a) replacet ) (b) equals()
which of the following access?
and to all its subclasses is declared with(d) none of these
A member visibleto its own class (c) private
U public protected
instance variables.
is mainly used to initialize values to (d) An object
UhA constructor (c) A class
(a) A method

Which one of the below is abinary relational operator? (d) &&


6)! (c)
(a) ==

What is the return type of aconstructor?


(b)double (c) void vá) No return type
(a) int

Given that: double x=Math. ceil(Math.abs(-7.3)): final value in x will be


6)8.0 (c)6.0 (d)9.0
(a) 7.0

Type of String is
e)primitive (b) reference (9wraper (d)none of these

Which of the following is not a wrapper class:


vá) Boolean (b) Double (c) Long (d) Int

The method that is used to extract a set of characters from a string:


(a) charAt() (b) endsWith( ) uc substring( ) (d) starts With( )

The prototype for a method addNum( ) that has two integers as argument and retums their sum:
(a) int addNum(int a, int b) (U voidaddNum(int nl, int n2)
(c) double addNum(double a, double b) (d) int addNum(int nl, int n2);
ation
chancterin
occurTence ofa specilicd On) ration
()chorAt) V) lostlndex
the lasto
the ndesof
thatrebns(hi
The method indexON)
(al compre Tor)
(d) this
keywont (e) publie
of the tollowing is not a
Whch (b)sod is: Mathelss
a) objv corresponding object(d)
datatvpe to its
converla pumitive MO) Wrpper
The class Nedto b)valueOr
(a) Striny isrunning
detected whilethe programare syntactically correct, ofAssertion(A)
are becnusethey esplanation
yAsYertiont A) Runtimeerots does not detectthem Reason(R)Ís acorect explanation of Assertion
ReasonR): The compiler (R)aretrue and a correct
L)Both Assertiom(A) and Reason Irueand
Reason(R)isnot
(R)are
b) Both Assertion (A) and Reason filse
c)Assertion (A)is true and Renson (R) is
Reason (R) is tnie
d)Assertion (A) is talse and
memory requirement (d) double
yIhich ofthe following has least (e) long
(a) short wb) byte
situations
to behave ditferently under different(d) Abstraction
It is an abilhty to have same name but Me) Polymorphisn
(a) Encapsulation (b) Inheritance

AssertioA): Given R7+4 2: The result ofR is 22.


Reason( R): Precedence of operator is more than that of operiator
explanation of Assertion (A)
(R) are true and Renson (R)is acorrect
(a)Both Assertion (A) and Rcason
explanationof Asseron
true and Reason (R) is not a correct
(b)Both Assertion (A) and Reason (R) are

(c) Assetion (A) is true and Reason (R) is false

ai Assertion (A) is false and Reason (R) is true

The statement: "COLLECTION" indexOf(A); willreturn a valueNotFound Exception


(a) Syntax error (b) 0 (c) -1

a JAVA method.
Avariable declaration can occur
(b) anywhere after its use in
(a) only in the beginning of (d)at the end of
ve)anywhere before its use in
|10x2
Question 2:
array using the following values:
M Write the syntax tocreate a 5 element String
AAA,ccc, EEE, Egg, JIJ

while lop.
j Rewrie usingj=7; i<6; itt, j- -)
for(int i=1,
System.out.printin (i +". "+ i"i ):

What is Autoboxing? Give example.


following arrays:
t i How many locations arereserved for the (b) char a ]= new charl(20]:
(a) int x(]=new int(25:
Whatwill be the final value in y, ify= 8initially ?
V Given that : 34
Page 3 of 4
Given the following code,
int n=2, s; what will be the output?
while( n<=10)
s= 3*n + 2;
if( s%4 == 0)

n+=2;
continue;
System.out.print( s);
Given:
switch (r)

case 7: k= 49; break;


case 14: k=7;
case 21:k=3; break;
default: k=1;

What will be the final value of k if:

Given: am =(p*2 >q+100 )?p:q:


What will be the value of anm if: (Yp= 100 q=125a/ I)p= 175 q=75
ANrite two properties of aconstructor.
L What will be the output of the given code snippet :
int PM[] =(5, 10, 20, 40, 80, 160);
for (int p =2; p< 6; p+=2)
System.out.print (" * "+ PM[p-1] );

Section B|15 x 4=60 marks ]


[Attempt any four programs fromthÉs section. Write a program in Java for the following.
Also write vriable description table for each program. Give commems wherever applicable)
QuestioD 3.
t Defneelass PARK, described as below :
Member Variables :
EntryFee (double)
Age (int)
Discount (double)
Amount (double)
Member Methods :
() PARKO)--Constructor to initialize member data to null.
() void Input() - To input values for member data - EntryFee, Age.
(1) void Calculate() Tocalculate the amount payable by giving the discount as per the following chart
Age (in years) Discount on EntryFee
<-12 45%
50 50%
otherwise 10%
(iv) void Display()-To display all the member data
above member methods.
Write a main()method to create an obiect of classPARK and call the
INti acasx oavevaluN H charactet artay ot size l0. Usime Bubble sort tecnique, Arrange lhem in ascening
oer lhslay the uns at the sttd arrav.

INDA

(0UNTRY

fon. Also calculate and print the


Dothe cdawo ve aluesimto a 4 aray. Display the elements in the matrix
eit ofelethents ocach con ofthe aray
Evample
AN 4.8,6,31, 5,3.2,6}, (4,2,6. 7)
Aray in matriy om 4563
S326
4267

Sunm of clements of Ist colunn 5 4 |3


Sum of elements of nd column $ 3 2 - 10
Sum of clements of rd column3 6 2 6 14
16
Sum of elements of 4th column ] 3+67

Question 7. has to bea four-digit


whether it is a Strontio Number or not. The number
Detine aclass to accept a number and check
Dumber give the same digit at the hundreds and tens place.
Strontio numbersare those four-digit numbers when muliplied by 2
Exampie !
Input: 1386
Output 1386 is a Strontionumber. the digits in the hundreds and tens place are same.
As 1386x2- 2772, where
Example 2:
Input I764
Strontio number.
Output 1764 is not a 764 N2 3528, where the digits in the hundreds and tens place are not same.
As I

Question 8. that:
etss to overload amethod named Pack(), given
Befine arguments.
Packtint a, int b)-to print the average of the ton
(a)vord
Packint n) - to print the square of the numbers from I
tb)void of the argument.
soid Packí String s) - to print the last character
4c)

--X

You might also like