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

CL 10 - COMP APP - Practice Paper 5

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

CL 10 - COMP APP - Practice Paper 5

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 - 5
COMPUTER APPLICATIONS

Class – X Max.Marks – 100

Attempt all questions from Section A and any 4 questions from Section B.
The intended marks for questions or parts of questions are given in brackets.
SECTION A (40 Marks)
Attempt all questions
Question 1. [20]

Choose the correct answer and write the correct option.

(i) The process of combining data and functions that enables them to be together as a single
entity is called:
(a) inheritance (b) encapsulation (c) classification (d) attributes

(ii) Which of the following for loop is not an infinite loop?


(a) for(;;) (b) for(a=0;a<1;a--) (c) for(a=0;;a++) (d) for(a=-1;a<1;a++)

(iii) Which of the following keywords is used to create an instance of a class?


(a) new (b) public (c) class (d) main

(iv) Which of the following statements is valid for the objects


(a) They possess same characteristics and behaviour.
(b) They possess same characteristics but different behaviour.
(c) They possess same characteristics and different behaviour.
(d) They possess same characteristics but common behaviour.

(v) How many bytes a char data type occupies in the memory?

(a) 2 (b) 8 (c) 4 (d) 16

(vi) Which of the following is non-numeric data type?


(a) boolean (b) int (c) float (d) double

vii) Name the programming technique that implements programs as an organised collection of
interactive objects.
(a) Procedure Oriented Programming (b) Modular Programming
(c) Object Oriented Programming (d) None of the above

viii) Which among the following is a valid class name?


(a) Simple Interest (b) SimpleInterest
(c) 1SimpleInterest (d) Simple@Interest

ix) Which among the following Scanner methods allows us to input a number with a decimal
point?
(a) nextInt() (b) nextFloat() (c) nextDecimal() (d) nextPoint()

x) Assigning value to a variable during declaration is called.


(a) Declaration (b) Assignment (c) Initialisation (d) None of the above

(xi) What is the name given to a memory location called in Java?


(a) Variable (b) Constant (c) Data Type (d) None of these

Page 1 of 4
(xii) Information passed to a method through arguments is called _______.
(a) Message (b) Variables (c) Numbers d) Data

xiii) Which among the following is a valid name for a function?


(a) function (b) 2function (c) fun in action (d) fun#

(xiv) If a function does not return any value, its return type should be:
(a) int (b) no-return (c) void (d) empty

(xv) For every object, separate memory is allocated to its __________ variables.
(a)Instance (b) Dynamic (c) Parameter (d) Static

(xvi) Which feature can be implemented using encapsulation?


(a) Inheritance
(b) Abstraction
(c) Polymorphism
(d)Overloading

(xvii) The output of Math.floor(5.2) is _________


(a) 5.0 (b) 6.0 (c) 6.5 (d) 5

(xviii) What among the following is not a component of message?

(a)An object identifier (b) A method name (c) Arguments (d)Data members

(xix) State the total size in bytes of the array p[4] of float data type?
(a)16 (b) 8 (c) 32 (d) 14

(xx) What will the code print?


int arr[]= new int[5];
System.out.println(arr);
(a)0 (b)0000 (c)Value stored in arr[0] (d) Garbage value

Question 2. [20]

i. Explain explicit type casting.

ii. Write java expression for the following:

a)4/3r3 b)(a+b)n/2a

iii. What is the return type of the Math.round() function if the parameter is :
a. float data type
b. double data type

iv. What will be the output of the following code?


int a=7; a+=a++ - ++a + --a + a--;
System.out.println("a ="+a);

v. What will be the output of the following code?

Page 2 of 4
a. double a = Math.ceil(17.3f);
b. System.out.println(“a=”+a);

vi. Find the errors in the given program segment and re-write the statements correctly to
assign values to an integer array.

int n[] = (2,4,6,8,10);

for(int i =0; i <=5; i++)

System.out.println(“n[“+ i + “]=” + n[i];

vii. Rewrite the following using if-else statement:


comm=(sale>15000)?sale*5/100:0;
viii. State the values stored in variables str1 and str2
String s1=”good”;
String s2=”world matters”;
String str1=s2.substring(5).replace(‘t’,’n’);
String str2=s1.concat(str1);

ix. How many constructors does a Character class contain?

x. What will be the output of the following


String A=”26”, B=”100”
int x=Integer.parseInt(A);
int y=Integer.parseInt(B);
System.out.print(x+y);

SECTION B(60 Marks)


Attempt any four questions from this Section.
The answers in this Section should consist of the Programs in either Blue J environment or
any program environment with Java as the base.
Each program should be written using Variable descriptions/Mnemonic Codes so that the
logic of the program is clearly depicted.
Flow-Charts and Algorithms are not required.

Question 3 : [15]
Write a program to input 5 characters and find the sum of those characters which are digits.

Question 4 : [15]
Define a class Salary in Java with the following details:
Data members:
name[] array to store names of 20 employees
netsal[] array to store net salary of 20 employees
member methods:
void input() - to accept the names of 20 employees and their corresponding net salaries.
void selection() – to sort the array netsal in descending order and arrange the names
accordingly.
void print() – to print the sorted data in the array.

Question 5 : [15]

Page 3 of 4
Write a program to display the pattern:
1
22
333
4444
55555

Question 6 : [15]
Print the sum of the following series:
1 + 12 + 123 + 1234 + ……….(123…n)

Question 7 : [15]
Write a program which prints all the prime numbers up to a given number. Take the number
from the user.

Question 8 : [15]
Develop a java program that will help in computing the following:
16*1, 14*2, 12*3, 10*4, 8*5, 6*6, 4*7, 2*8

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

Page 4 of 4

You might also like