[go: up one dir, main page]

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

Compt 1

The document is a pre-board examination paper for Computer Applications for Class X at Delhi Public School Megacity, Kolkata. It includes multiple-choice questions, programming tasks, and theoretical questions covering various topics in Java programming. The paper is structured into two sections, with Section A focusing on theoretical questions and Section B requiring programming solutions.

Uploaded by

ambanipramey
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)
18 views5 pages

Compt 1

The document is a pre-board examination paper for Computer Applications for Class X at Delhi Public School Megacity, Kolkata. It includes multiple-choice questions, programming tasks, and theoretical questions covering various topics in Java programming. The paper is structured into two sections, with Section A focusing on theoretical questions and Section B requiring programming solutions.

Uploaded by

ambanipramey
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

Delhi Publhc SchoolMegacity, Kolkata

Pre-Board Examinatlons 2022-2023

Subject: Computer Applications


Class: X
Full Marks: 100
Time: 2 hrs.
Section A (Attempt all)
Question 1 [1x20-20]J
Choose the correct answer and write the correct option.
) JVM is a/an.
a) compiler
b) interpreter
c) assembler
d) keyword
(i) void is a/an
a) Operator 0. tb
b) Literal.
c) Keyword. i nolibnoo doo
d) Identifier.
(ii) Which return type ofa method does not return any value? wob
a) int ol botesn (b
b) float
c)void
d) double
6dofwe
(iv) The following example of constructor of class X is known as -

Xfint a, float b)
a) Default Constructor
b) Parameterized Constructor
c) Non-Parameterized Constructor
d) Copy Constructor

(v) Identify the keyword from the following list


a) has
b) then
c) true
d) next
M eX nlcnob
0.8
Find out the invalid statement
from the following
(vi)
a) Class is a data type.
b) Class is an object factory.
c) Class is a blueprint.
d) Class is an instance of an object.
are created for each object. ib s t
Separate copies of
(vii)
a) Static Variable
b) Class Variable
c) Instance Variable
d) Local Variable
Page 1 of 5
out second last character fromn the
the stnng
strin
vii Which statement willbe used to find
variable st.
a) char ch=st.charAt(st.length|-2
b) char ch= charAt(st.length0-1);
c) char ch= st.charAt(st.length(-3);
d char ch= st.charAt[length0-2);
ix) cannot deal with fractional values.
a) if- else
b) array
c) switch case
d nested if else bgo Joerio
(x) Find out the value of d. igmo
int cl-15,2,4,7,94,22, 15,6;
double d-c[1*5] % Math.pow(c|1],3);
a))6
b) 7.0
c) 2.0
nsle elbiov
d) 6.0
(xi) In loop condition is mentioned after the loop body.
a) for val
b) while Risbl
c) do while
d) nested for
ulev s oriun oneob bodrem aoid
(xii) What will be the value of y after execution of switch
int x-3,y4; statement:o
switch(x+3) aldteb
worl al Xeesb 1o 1odpunte i
case 6: y=0;
case 7: y=1;
default :y+=1;

a) 0
b) 1
2 volle adt aot biowreol ndi inbl
d) 5
(xii) Find out the value of X:
double X=Math.sqrt{Math.abs(Math.ceil(20.8 30.6);
a) 3.0
b) 3.16
c) 2.0
d) 2.8

(xiv) An overloaded method consists of,


a) The same method name with different parameter list.
b) The different method name with different number of parameters
c) The same method name and same number and same type of
same order of
parameters in
d)
parameters
The different method name with different types of parameters

Page 2 of 5
xv) Identify the type of of n (if n-4 then
Factorial of

4-1x2x3x4-24). error
O to to find
find out the
factorial

class Factorial

public static void


main(int n)
int a-0;
forfint i1; ie=n; it+)
a-ai;
System.out.printfa);
a) Syntax Error
b) Logical Error
c) Runtime Error
d) Exception
is called.
xvi) Wrapping up of data and method together in a single unit
a) Data Hiding
b) Data Abstraction
c) Encapsulation
d) Polymorphism
(xvii) Find out the output of the following coding:
int all-{5,6,2,1,7,8,3;
int i-2;
it=++a[3]+a[4+1]++%(5-a[2]);
System.out.printi);
a) 6
b) 5
c) 8
d) 10
known as?
is also
"?:" or ternary operator
xviii) In Java programming
a) Shorthand operator
b) Relational operator
Conditional Assignment operator
c)
d) Iterative operator
rond
function belongs t o class.
(xix) parselnt)
a) Integer
b) Stringg
c) Character

ooto d) Long
within the same class
accessible only
modifier which is
the a c c e s s
(xox) Identify declared.
where it is
a) class

b) private
c) protected
d) public

Page 3 of 5

X-Com Abp
Question 2
Evaluate the following expression and finout thne value of A.(Show working [2x10-20
int A-50,x=20;
A/=x++ %9-++x/(7+3) +x
iDefine infinite loop and give example using while loop. pildug
Write the java
expressions for
iv)
L
a) | A2+ 3B3 b a''s=Va
Wite down the
int x-8, y=50; output
of the following statement. (Show
working)
intz= x*10>y+30? x*10+y: x<=y/5? *y: Y/x;
What is the value of x if int n[l-2,5,7,8,9,11,3) (Show working)
,

int
x=Math.min(n|4],n[6|) n[n.length-2]* 10;
+

Name the following:


a A keyword used to make a variable as class variable.
b) A
keyword used to call a package in a program
Write the java statements for the
following:
a) Check if the second character of a
b) Find the position of last p' from thestring
word
variable 'str is in
uppercase.
(vii Analyze the given "Applications".
program segment and answer the
for(int i=3; i<=4; it +){ boo wollo odh following questions
forint j-2; j<i; j++)
System.out.print(" ";
System.out.println("WIN");}
(1) How many times does the inner
loop execute?
(i) Write the output of the
program segment.
Differentiate between constructor
Write the output for the
and function. (2 points)
String s= "Today is Test";following
System.out.println(s.indexOf(T);
System.out.println(s.substring(0, 6) +*"+ "Holiday); bertisod2
SectionB
The this section should (Attempt Any Four)
answer of [15 x 4-60]
consist of programs in either BlueJ
any
Each program should be program environment with java as the base. environment or
written
logic of the program is clearly using variable description/mnemonic codes so that the
depicted. Flowchart and algorithms are
Question3 not required.
1) Write a Java Program to print the following using the
Overloading. concept of Function
i)void show) - Display a horizontal
i) void show(int n) line of 50 "
Display
-

1 3 6 the following series for 'n' number of terms.


10
iii)voidshow(char 15.... n terms
with character 'ch'. ch,int n) Display the following pattern for 'n'
-

number of lines
$$$$
$$$
$$
when ch $'and n =4]
Write the main()
=

function to create an object of tne class and call the


functions,
Page 4 of 5
Queatiop4
the
Wrie a menu driven from the user and perform

following operations. program t o to accept


accept an integer
an
"
1. Check and 4, 100 etc)
display if it is a (E.g. 16, 36, s u m digits
2. Check and display if it is aPerfect
number or not.
Tect Square not [Neon Number: if the of
of square of the number is Neon Number
umber or not O2 81, or

equal to the number. (B 8+19]


Question 5
Count and display the
Write a Java program to accept a
word,Convert
number of pairs of consecutive alphabets
it into u p p e r c a s e .
present in tne display the pa irs.

For example:- Number of pairs


-3
If the word isSTUDENT, then it will display ST, TU and DE
Question 6
Write a program to store n ' numbers in double array (Assume tnat u
the
nia to search. Search the number in array
Storeain ascending order). Accept a display suitabie
its position otherwise
using Binary Search Technique. If forIndienlav
message.
Question 7
in an
of integers (both positive and negative) count
Write a Java program to accept n'number followed by the positive numbers. AIso
array. Display all the negative numbers first
and display the number of negative numbers.

Questlon 8
Define a class ElectricBill with the following specifications:
Class Name ElectricBill
Instance variables /data member:
String n - to store the name of the customer
int units - to store the number of units consumed
double bill - to store the amount to be paid
Member methods initialize data members with their
default values.
( ) Default constructor to
ElectricBill -

consumed by a customer.
number of unit
void accept() To accept name and
-

the following tariff:


void calculate) to calculate the bill as per
-

Rate per unit


Number of Units
First 100 units Rs. 2.00/unit
Next 200 units Rs. 3.50/unit
Above 300 units Rs. 5.00/unit
void print0 To print the details in the following format:
Name of the customer:,
consumed:.
Number ofunits
Bill amount: .

Write a main() method to create an object of the class and call the above member methods.

* * * * * *k*******************

X-Com AMP. Page 5 of 5

You might also like