0% found this document useful (0 votes)
61 views6 pages

Preparatory 1

This document is an examination paper for Computer Applications for Class 10 at Holy Spirit School for the academic year 2022-2023. It consists of two sections: Section A requires students to answer all questions, while Section B allows them to choose four questions to answer. The paper includes multiple-choice questions, programming tasks, and theoretical questions related to Java programming concepts.

Uploaded by

revanandhini.09
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views6 pages

Preparatory 1

This document is an examination paper for Computer Applications for Class 10 at Holy Spirit School for the academic year 2022-2023. It consists of two sections: Section A requires students to answer all questions, while Section B allows them to choose four questions to answer. The paper includes multiple-choice questions, programming tasks, and theoretical questions related to Java programming concepts.

Uploaded by

revanandhini.09
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

HOLY SPIRIT SCHOOL(ICSE)

FIRST PREPARATORY EXAMINATION 2022-2023


COMPUTER APPLICATIONS
DATE: MARKS : 100
CLASS:10 TIME : 2 Hours
_______________________________________________________________
Answers to this Paper must be written on the paper provided separately.
You will not be allowed to write during the first 15 minutes.
This time is to be spent in reading the question paper.
The time given at the head of the Paper is the time allowed for writing the answers.

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
(Attempt all questions from this Section)

Question 1 [20]
Choose the correct answer and write the correct option.

i. Arrange the following operators according to their order of precedence.


1. && 2. % 3. >= 4. ++
a. 4, 1, 3, 2
b. 4, 3, 2, 1
c. 4, 2, 3, 1
d. 1, 2, 3, 4

ii. What will be the output of [Link]([Link](-10.23)) ?


a. 10.0
b. 11
c. -11.0
d. 11.0

iii. All the methods of a package can be imported by using the ______ character with
import statement.
a.- b./ c.* d.?

iv. What value will be returned by compareTo( ) method if the invoking string is
smaller than the compared string?
a.A positive number
b.A negative number
[Link] invoking string
[Link]

v. Which access-specifier prohibits the use of a member of a class, outside the class?
a. public
b. private
c. protected
d. None of the above

vi. The Java principle that allows one class to use the properties of another class is :
a. Polymorphism
b. Encapsulation
c. Abstraction
d. Inheritance

vii. Which is the method that accepts a string without space?


a. nextLine()
b. next()
c. nextFloat()
d. nextInt()

viii. Which is the element represented by arr[4]?


a. 4th
b. 3rd
c. 5th
d. 1st

ix. What will be the output of “SING”. compareTo (“SINGING”); ?


a. 3
b. 73
c. -73
d. -3

x. What will be the output when the following code is executed?


int m=3, n=5, p=4;
if ((m= =n) && (n!=p))
{
[Link] (m*n);
[Link] (n%p);
}
if ((m!=n) || (n= =p))
{
[Link] (m + n);
[Link] (m - n);
}
a. 35-2
b. 8
-2
c. 8-2
d. 6

xi. Which of the following can be used to separate the words of a variable name?
a. Space
b. Comma
c. Underscore
d. Dollar

xii. What will be the value returned by the following function?


int test()
{
int a=6, b=7;
int sum=a+b;
int pr=a*b;
return sum;
return pr;
}
a. 42
b. 13 42
c. 13
d. 55

xiii. How many times will the following loop be executed and what will be the output?
int i;
for ( i=5 ; i>10 ; i++ )
[Link](i);
[Link](i * 4);
a. 5 times, o/p 5678940
b. 0 times, o/p 20
c. 1 time, o/p 524
d. 5 times, o/p 5678910
xiv. Which among the following is a logical error?
a. Missing semicolon
b. Mismatched braces in classes and methods.
c. Misspelled keywords and identifiers.
d. Addition is required but subtraction is performed

xv. To extract the 3rd character from a string str, the statement would be
a. [Link] (2)
b. [Link] (2)
c. [Link] (3)
d. [Link] (3)

xvi. What will be the output of [Link](25, 1/2) + [Link](16) ;


a. 9.0
b. 5
c. 5.0
d. 29.0

xvii. What will the following code print?


int arr[]=new int[5] ;
[Link](arr)
a. 0
b. value stored in arr[0]
c. 0000
d. garbage value

xviii. The function used to convert a String value to double data type is :
a. [Link]()
b. [Link]()
c. [Link]()
d. [Link]()

xix. The variables x and y, in the statement, void calc( int x, int y) are called :
a. Actual parameters
b. Instance variables
c. Static variables
d. Formal parameters

xx. What is the maximum value that the following statement will evaluate to?
(int)( [Link]() * 6 );
a. 5
b. 5.0
c. 6
d. 6.0

Question 2

i. What will be the output if a value 7 is passed as parameter to the function?


void calc (int a)
{
int x=2;
a = ++a / x + a++ / ++x;
[Link](a);
} [2]

ii. Define abstraction. [2]

iii. Write the output of :


“ACHIEVEMENT”. replace (‘E’,‘A’) . toLowerCase() . charAt (4); [2]
iv. What will be the conversion type and output of the following, if [2]
int i = 67, k;
char c = ‘e’, r;
a. k = i + c ;
b. r = (char) i ;

v. Find the errors and rewrite correctly. [2]


a. int x[10]={3,2,4,5,6,7};
b. char x={'j', 'n', 'k', 'p'};

vi. If the args[ ] argument of the main() method receives {“Java”, “is”, “challenging”},
what will be the values of args[ 0] and args[2]? [2]

vii. Explain Fall-through in switch-case with an example. [2]

viii. Write the java expression for : [2]

a2 +b2 x (a+b)8
|a + b|

ix. What will the output of the following statements be, if : [2]
int a[ ]={1,2,3,4,5};
a. [Link](“The value is :”+2+a[3]);
b. [Link](“The value is :”+ (a[4] % a[1]));

x. How will the following array be after 3 iterations of bubble sort? [2]
int a[]={78,16,9,4,11,30,18,1,28,5};

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 written using variable description / mnemonic codes so that the logic
of the program is clearly depicted.
Flowcharts and Algorithms are not required.
Question 3

Define a class Mobike (which calculates the charges for renting a bike), having the following
members :
Data members :
String bNo - Stores the bike’s number
int phNo – Stores the phone number of the customer
int days – Stores the number of days the bike is taken on rent
double charges – Stores the rental charges after calculation
Member methods :
public Mobike()-Parameterized constructor which accepts all the values, except charges, from
main() method.
void compute()-Computes the rental charges as follows,

No. of days Rate


First 5 days Rs. 400 per day
Next 5 days Rs. 600 per day
Rest of the days Rs. 900 per day
void display() - Displays the output in the following format.

Bike No. Phone No. No. of days Charge


--------- ------------ ------------- --------
main()-Accepts the details from the user and calls the above methods. [15]
Question 4

Write a menu-driven program as follows :


Choice 1: accepts an int value ‘a’ from the user and displays the sum of the following series :

1 + 2 + 3 +….+ 10
a a2 a 3 a10

Choice 2 : Displays the following pattern :

5 4 3 2 1
5 4 3 2
5 4 3
5 4
5
Display “Invalid Choice” for a wrong choice. [15]

Question 5

Design a class Overload, which overloads the function display() as follows:

[Link] display(String str, int p) - Takes one string and one integer argument. It displays all the
uppercase characters in str, if variable p is 1, else displays all the lowercase alphabets.

[Link] display(String str, char chr) – Takes one string argument and one character argument. It
displays all the vowels if chr is ‘v’ else displays all the consonants. [15]

Question 6

Write a program to perform function overloading as follows :

StringManip(String s) – Accepts a string from main() and displays the string after replacing
each vowel by Asterisk (*).
Ex. If s=“Street Play”, then the output should be “Str**t Pl*y”.

StringManip(String s, char c) – Accepts a string and a character from main() and counts the
number of times the character occurs in the string.
Ex. If s=“Street Play” and c=‘e’, then the output will be 2.

main() method calls the above methods and passes the parameters. [15]

Question 7

Write a program to input 10 integers into an array and perform Bubble Sort in Descending
order. Display the sorted array. [15]

Question 8

Write a program to input 6 double values into an array and display the largest and the smallest
element in the array. [15]

XXXXXX

You might also like