0% found this document useful (0 votes)
38 views

GR 10 CTA QP Sample Paper

Uploaded by

h
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)
38 views

GR 10 CTA QP Sample Paper

Uploaded by

h
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/ 9

COMPUTER APPLICATIONS

Sample Paper
Grade: X Max. Marks : 100
Date:dd/mm/yyyy Time : 2 hrs

INSTRUCTIONS:

• 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 this paper is the time allowed for writing the
answers.
• The intended marks for the questions or parts of questions are given alongside
the questions.
• This paper is divided into 2 sections.
• Answer all questions from Section A, and any four questions from Section B.

Section A (40 Marks)


(Attempt all the questions from this section.)
Q. 1 [20]
Choose the correct answer and write the correct option.
(i) Identify the principle of OOP from the following:
(a) Inheritance
(b) Class
(c) Object
(d) Method

(ii) This code is in the form of binary numbers. It is machine readable.


(a) Source code
(b) Object code
(c) JVM code
(d) Compiler code

1
(iii) Which of the following is called a factory of objects?
(a) Function
(b) Class
(c) Package
(d) String

(iv) This keyword is used to create an object of a class.


(a) break
(b) import
(c) System
(d) new

(v) What is the type of casting shown by the following example:


double x =15.34;
int y= (int) x;
(a) Implicit
(b) Explicit
(c) Primitive
(d) Composite

(vi) Which of the following is not a token in java.


(a) Operators
(b) Separators
(c) table
(d) Keywords

(vii) Which one of the following is an example of a default constructor ?


(a) void Sample(int a, int b)
(b) void Sample2(String a, int b)
(c) Sample3()
(d) Sample4(String c, int d)

(viii) Which one of the following is not a feature of a constructor?


(a) It must have a return type even if it is void.
(b) It has the same name as the class.
(c) Invoked using the new operator
(d) It is used to assign values to instance variables in the class.

2
(ix) Choose the java statement to create an object named ball of the class
named Cricket.
(a) Cricket ball=new Cricket(System.in);
(b) ball Cricket=new Cricket();
(c) Cricket ball=new Cricket();
(d) ball Cricket=new Cricket(System.in);

(x) Give the function prototype of a function fun with int a and char b as
parameters and no return type.
(a) void fun(int a, char b)
(b) int fun(int a, char b)
(c) char fun(int a, char b)
(d) void fun()

(xi) Which of the following is not an example of composite data type? [2]
(a) String
(b) class
(c) Array
(d) long

(xii) Name given to a variable, function or a class is called as:


(a) keyword
(b) separator
(c) constant
(d) identifier

(xiii) What is the size in bits of the following data types?


(i) short (ii) char
(a) 16 bits, 16 bits
(b) 8 bits, 8 bits
(c) 2 bits, 4 bits
(d) 2 bytes, 4 bytes

3
(xiv) Which of the following is not a separator in java?
(a) (
(b) +
(c) }
(d) ;

(xv) Predict the output of the following snippet:


int p;
for (p=1;p<=3;p++)
{
if(p%2 ==0)
{
p*=2;
System.out.print(p+" ");
}
}
(a) 248
(b) 48
(c) 4
(d) 8

(xvi) Predict the output of the following snippet:


int a=10;
while(a<20)
{
a+=3;
System.out.print(a+ " ");
}
(a) 13 16 19 22
(b) 10 13 16 19
(c) 13 16 19
(d) 19

4
(xvii) Math.sqrt() is a type of function.
(a) Inbuilt
(b) User defined
(c) Both (a) and (b)
(d) None of the above

(xviii) In this type of function calling, the value of actual parameter is copied
to the formal parameter.
(a) Call by Reference
(b) Call by value
(c) Inbuilt
(d) User defined

(xix) The automatic conversion that the Java compiler makes between the
primitive types and their corresponding object wrapper classes is called
as
(a) Autoboxing
(b) Unboxing
(c) Implicit
(d) Explicit

(xx) What will be the output for the following program segment?
String s="malayalam";
System.out.println(s.substring(0,2)+s.substring(4,6));
(a) yalam
(b) malyal
(c) malay
(d) maya

Q. 2
[20]
(i) What is a JVM? [2]
(ii) What are comments? [2]
Which of the following are valid comments?
(i) /*comment*/ (ii)/*comment (iii) //comment (iv) */comment*/

5
(iii) State one similarity and one difference between while and for loop. [2]
(iv) Write the output of the following program: [2]
class Design
{
public void main ()
{
char ch='M';
for (int i=0; i<3; i++)
{
for (int j=0; j<=i; j++)
{
System.out.print(ch);
ch++;
}
System.out.println();
}
}
}
(v) State the values for x and y [2]
int c=900, n=2000;
int x=0, y=0;
x= n+(c>2550? 1350:1500);
y=n+c>2550?1350:1500;
System.out.println("x="+x);
System.out.println("y="+y);
(vi) What will be the result stored in x after evaluating the following [2]
expression:
int x=4;
x+=(x++)+(++x)+x;
(vii) Name the following: [2]
(i) This access specifier allows the member variables and functions
to be accessed only in the class.
(ii) This type of variable is also called as the class variable.

6
(viii) State the purpose and return data type of the following String [2]
functions:
(i) indexOf( )
(ii) compareTo( )
(ix) Differentiate between isUpperCase() and toUpperCase() [2]
(x) How many memory bytes will be occupied by the following array? [2]
float n[8];
long x[10];

Section B (60 Marks)


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

Q. 3 Define a class named BookFair with the following description: [15]


Instance variables/Data members:
String Bname – stores the name of the book.
double price – stores the price of the book.
Member Methods:
(i) BookFair() Default constructor to initialize data
members.
(ii) void Input() To input and store the name and the
price of the book.
(iii) void calculate() To calculate the price after discount.
Discount is calculated based on the following criteria:
Price Discount
Less than or equal to Rs 1000 2% of price
More than Rs 1000 and less
than or equal to Rs 3000 10% of price
More than Rs 3000 15% of price

7
(iv) void display() To display the name and price of the book
after discount.
Write a main method to create an object of the class and call the above
member methods.

Q. 4 Write a program to input a number and print whether the number is a [15]
special number or not. (A number is said to be a special number, if the
sum of the factorial of the digits of the number is same as the original
number).
For example: 145 is a special number, because
1!+4!+5!=1+24+120=145

(where ! stands for the factorial of the number and the factorial value of
a number is the product of all integers from 1 to that number, example
5!=1*2*3*4*5=120)

Q. 5 Design a class to overload a function series() as follows: [15]


(i) double series(double n) with one double argument and returns
the sum of the series
sum=

(ii) double series(double a, double n) with two double arguments


and returns the sum of the series
sum=

Q. 6 [15]
Write a program in java to store the numbers in a 4*4 matrix in DDA.
Arrange the numbers of each row in ascending order and display
the result.

8
Q. 7 Write a program to accept a word and convert it into lowercase [15]
if it is in uppercase, and display the new word by replacing only
the vowels with the character following it.
Example:
Sample Input: computer
Sample Output: cpmpvtfr
Q. 8 Write a Program to accept the year of graduation from school [15]
as an integer value from the user. Using Binary search
technique on the sorted array of integers given below, output
the message "Record exists" if the value input is located in the
array.
If not, output the message "Record does not exist".
{1982, 1987, 1993, 1996, 1999, 2003, 2006, 2007, 2009, 2010}

*****

You might also like