0% found this document useful (0 votes)
33 views3 pages

Class 10 - Practice Paper 2 - 2022-23 - Comp App

computer application 2022 practice paper

Uploaded by

0613.apobangpo.7
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)
33 views3 pages

Class 10 - Practice Paper 2 - 2022-23 - Comp App

computer application 2022 practice paper

Uploaded by

0613.apobangpo.7
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/ 3

The Bishop’s Co-Ed School, Undri

PRACTICE PAPER 2
COMPUTER APPLICATIONS

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)
Question 1 [20]
Choose the correct answers to the questions from the given options.
(Do not copy the question. Write the correct answers only)

(i) Which of these is a super class of wrappers Long, Character and Integer?
(a) Long (b) Digits (c) Float (d) Number

(ii) Which of the following statements are incorrect?


(a) String is a class (b) Strings in java are mutable
(c) Every string is an object of class String
(d) All of the above

(iii) What will be the output of the following Java program?


class string_Term2
{ public static void main(String args[])
{ String obj = “I” + “like” + “Java”;
System.out.println(obj);
}
}
(a) I (b) like (c) Java (d) IlikeJava

(iv) Which of these is a wrapper for simple data type char?


(a) Float (b) Character (c) String (d) Integer

(v) Non static functions can access :


(a) Static data members (b) Non static data members (c) Both (a) and (b) (d) None
of these

(vi) Given a string str=”FilmFestival2021”;


The statement str.substring(4,12).toUpperCase() will produce :
(a) Film (b) Fest (c) Festival (d) FESTIVAL

(vii) Which among the following best describes encapsulation?


(a) It is a way of combining various data members into a single unit.
(b) It is a way of combining various member functions into a single unit.
(c) It is a way of combining various data members and member functions into a single
unit which can operate on any data.
(d) It is a way of combining various data members and member functions that operate
on those data members into a single unit.

(viii)The most strict access specifier is:


(a) Private (b) Public (c) Protected (d) Default

(ix) Consider the following two statements : int x = 25; Integer y = new Integer(33);
What is the difference between the set of statements?
(a) Primitive data types (b) Primitive data type and an object of a wrapper class
(c) Wrapper class (d) None of the above

(x) Void is not a wrapper class


(a) True (b) False
(xi) Each primitive datatype belongs to a specific:
(a) block (b) object (c) wrapper class (d) none of these

(xii) The process of restricting the free flow of data from the outside world is known as:
(a) Encapsulation (b) Inheritance (c) Function (d) Class

(xiii) Given array int x[] = {11, 22, 33, 44}; the value of x[1+2] is _________.
(a) 11 (b) 22 (c) 33 (d) 44

(xiv) Which of these is a wrapper for simple data type boolean?


(a) Bool (b) Boolean (c) True (d) False

(xv) Which of the following methods checks that a string starts with a particular string
or not?
(a) Starts() (b) Startswith() (c) startsWith() (d) StartsWith()

(xvi) Given a string str=”Publicaccess”;


To display the 3rd and 4th characters in uppercase the statement will be :
(a) System.out.println(str.substring(2,4).toUpperCase());
(b) System.out.println(str.substring(2,3).toUpperCase());
(c) System.out.println(str.substring(2).toUpperCase());
(d) System.out.println(str.substring(2,4).touppercase());

(xvii) To make accessibility to own class, classes of same package and child classes the
accesss pacifier should be :
(a) Private (b) Public (c) Protected (d) Default

(xviii) Given a string trn=”HimgiriExpress”, the statement that will show “EXPRESS”
from the string will be :
(a) trn.right(4)
(b) trn.substring(7)
(c) trn.substring(7).toUpperCase()
(d) trn.right(7,16). toUpperCase()

(xix) The output of the following code is :


public class myclass
{ public static void main(String []args)
{ String s1 = new String(“Ram”);
String s2 = new String(“Laxman”);
System.out.println(s1 = s2);
}
}
(a) Ram (b) Laxman (c) RamLaxman (d) False

(xx) Which of these access specifiers must be used for main() method?
(a) private (b) public (c) protected (d) none of the mentioned

Question 2 : [20]
(i) The output of “VIDYALAYA.”substring(2,5) will result in ________.
(ii) The replace() function requires at least ________ parameters.
(iii) State the method that :-
(i) Converts a string to a primitive float data type.
(ii) Determines if the specified character is a lower case character.
(iv) What is an infinite loop ? Write an infinite loop statement.
(v) What is a package ? What is the significance of „*‟ while importing a package ?
(vi) Write the prototype of a method named fnFest, which returns a boolean value and
takes a String argument.
(vii) Differentiate between formal and actual parameters.
(viii) What is method overloading ? Which OOP concept is implemented through
function overloading ?
(ix) Evaluate, if x = 4 :– [2]
1. double y = Math.ceil(8.2) + x++;
2. double z = ++x * Math.round(x);
(x) Study the method and answer the given questions :- [2]

public void sampleMethod()


{
for ( int I =0; I < 2; I++)
{
int number = (int) (Math.random()*10);
System.out.println(number);
}
}
1. How many times does the loop execute ?
2. What is the range of possible values stored in the variable number?

SECTION B
Attempt any four questions from this Section
Question 3: [15]
Define a class with an integer array to store 6 integers and a main function to accept 6
numbers in the array and swap the adjacent elements.

Question 4. [15]
Given the specification of the following classS tudent.
Class name : Student
Data members
Roll integer
Name String
Term1marks float
Term2marks float
Perc float
Member functions
getStudent() – To input student roll, name and marks in 2 terms and calculate
percentage (Formula : Perc=(Term1+Term2)/2)
showStudent() – To display student name and percentage.

Question 5. [15]
Define a class to accept 10 strings and a search string. Search for the string and display
whether found or not. If not found , display proper message.

Question 6. [15]
Write a program that reads a long number, counts and displays the occurrences of each
digit in it.

Question 7. [15]
Write a program in Java to accept a String in upper case and replace all the vowels
present in the String with Asterisk (*) sign.
Sample Input: “RELIANCE INDUSTRIES”
Sample output: R*L**NC* *ND*STR**S

Question 8. [15]
Input a String and display it in the following patterns :-
B BLUEJ
Bl LUEJ
BlU UEJ
BlUe EJ
BlUeJ J

You might also like