0% found this document useful (0 votes)
55 views4 pages

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

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)
55 views4 pages

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

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/ 4

The Bishop’s Co-Ed School, Undri

PRACTICE PAPER 1
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) Total size of array A having 25 elements of char type :-
a. 25 bytes
b. 100 bytes
c. 50 bytes
d. 10 bytes
(ii) Write the output for the following :-
String s1 = “Life is Beautiful”;
System.out.println(“Earth” + s1.substring(4));
System.out.println(s1.endsWith(“L”));
a. Earth is Beautiful and true
b. Earth is Beautiful and false
c. Earthis Beautiful and true
d. Earthis Beautiful and false
(iii) A wrapper class converts :
a. int to float
b. float to int
c. String to StringBuffer
d. Primitive data type to object
(iv) Which statement among the following will not create an array?
a. int ar1[]=new int[10];
b. float ar1[]=new float[10];
c. byte ar1[]=new byte[10];
d. int ar1=new int[10];
(v) Composite data types are formed by using:
a. Class variables
b. Primitive data types
c. Static data types
d. Method names
(vi) In which case would binary search terminate in one search?
a. If the middle element is the target
b. If the first element is the target
c. If the last element is the target
d. In all cases
(vii) Find the output of the following code: System.out.println(“UniVersAl”.indexOf(„V‟));
a. 2
b. 3
c. 4
d. 5
(viii) Which among the following can be used together in a single class?
a. Only private
b. Private and Protected together
c. Private and public together
d. All access specifiers together

(ix) If int m [ ] = {2,4,6,8,10}; what is the value of x ?


x=m[0] *m[2]*m[4] ;
a. x=18
b. x=14
c. x=120
d. x=64

Page 1 of 2
(x) State the output for the following code:
char ch1='T',ch2='C';
int d = (int)ch1 - (int)ch2;
if (d > 0)
System.out.println("Second character is smaller");
else if (d < 0)
System.out.println("First character is smaller");
else
System.out.println("Both the characters are same");
a. First character is smaller
b. Second character is smaller
c. Both the characters are same
d. Incorrect code
(xi) What output will the following code produce ?
class trial
{ static void main()
{
String s1=null;
System.out.println(s1.toString());
}
}
a. “null”
b. java.lang.NullPointerException
c. null
d. None of these
(xii) Given the following lines of code. Choose correct option.
int []myar = new int[5];
myar=new int[6];
a. The array is extended losing its contents.
b. The array is extended keeping the contents.
c. The 2nd line assigns a new size to myar.
d. None of these.
(xiii) Write statements that will produce the output given with respect to the string and
character given below :
String str=”Festivals@2022”;
char ch=str.charAt(5);
Statement to produce the output „FESTIVALS@2022’
a. str.sentenceCase()
b. str.upper()
c. str.toUpperCase()
d. str.toUpper()

Answer questions with respect to the diagram given below :-


Package myPack
Class : A Class : C
private int x; void remove()
pubic void add()
Class : D (child of B)
Class : B
private double m;
protected float p;
protected void modify()

(xiv) The data members in among all the classes are :-


a. private int x, protected void modify
b. protected void modify, public void add
c. private int x, private double m
d. public int x, private double m

Page 2 of 2
(xv) private double m is accessible in ?
a. Class A, Class B
b. Only class D
c. Class B, Class C
d. Only class B

(xvi) The modify() function is accessible in ?


a. Class A, Class B
b. Class B only
c. Class B, Class D
d. Class A, Class B, Class D
(xvii) Give the output of the following String functions :-
"PIZZERIA".endsWith("PIZZA".substring("PIZZA".length()-1)));
a. 0
b. false
c. true
d. 5
(xviii) Write the prototype of a method named fnNook which returns a boolean value,
and takes a string argument.
a. boolean fnNook()
b. boolean fnNook(String)
c. boolean fnNook(String s)
d. void fnNook(String s)
(xix) Choose the correct empty loop from the following :
a. for(int x=10;x>100;x--)
b. for(int x=10;x<=100;x++)
c. for(int x=10;x>100; )
d. for(int x=10;x<=100;x++) ;
(xx) What is the purpose of „this‟ keyword ?
a. Resolves conflict between a local and global variable bearing the same name
b. Refers to the current calling object
c. Both (a) and (b)
d. Only (b)

Question 2. [20]
(a) Name the keyword that :-
(i) Distinguishes between instance variables and class variables.
(ii) Calls a package in the program.
(b) State one difference and one similarity between do-while loop and while loop.
(c) Differentiate between a constructor and a method.
(d) How can class be used as a user defined data type ? Explain it with the help of
an example.
(e) What is the difference between length and length() functions.

SECTION B
Attempt any four questions from this Section

Question 3. [15]

Write a program to input 10 numbers into an integer array and find the average of even as
well as odd numbers separately.

Question 4. [15]

Write a program to accept a String type array s[] as parameter and print the smallest
word in it.

Page 3 of 2
Question 5. [15]

Write a program to accept an email address and output username, domain name (mail
server) and domain separately.
Sample input : - jsmith@outlook.com
Sample output :-
Username : jsmith
Domain name : outlook
Domain : .com

Question 6 [15]

An e-store announced the following seasonal discounts on certain items purchased. Create
a class with the following details to handle this task.
Class : E_Store
Data members : String itname, long tcost, float discount, double amount
Member functions :
void Accept() – Input the item name and its total cost.
void Compute() – Calculate the seasonal discount as given below :-
Item name Discount on total cost
LandPhone 50%
Mobile 30%
Tab 25%
Laptop 40%
Otherwise 10%
void display() – Print the discount and amount payable.
Also use the main() to create an object and execute the above member methods.

Question 7 [15]

Write a Java program to accept a positive integer in main() and pass it to another
function double COMPUTE(int m). This method will calculate and return the norm of
the passed number, back to main(). The norm of a number is the square root of sum of
squares of all digits of the number.
Sample input : Enter a positive integer :- 68
Sample output : The norm of 68 is 10

Hint : 6x6 + 8x8 = 36 + 64 = 100. √ is 10. Hence, norm of 68 is 10

Question 8 [15]

Design a class to overload a method fnPrint() given that :-


a) void fnPrint(int n)
105, 5, 110, 10, 115, 15………upto n terms

b) void fnPrint()
12345
2345
345
45
5

**************

Page 4 of 2

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy