CTA Practice Paper 5
CTA Practice Paper 5
PRANAVANANDA VIDYAMANDIR
PRE-BOARD EXAMINATION: 2024-2025
COMPUTER APPLICATIONS
Date: 13-01-2025 CLASS-X Time-2Hrs
(Theory)
(Two 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 this Paper is the time allowed for writing 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 [ ]
This Question Paper consists of 7 printed pages.
SECTION –A [40 Marks]
Attempt all questions
Question 1 [20]
Choose the correct answers to the questions from the options:
(Do not copy the questions, write the correct answers only)
Question 2
i) Consider the following program segment and answer the questions given below:[2
int x [][]={{2,4,5,6},{3,7,8,1},{43,1,10,9}};
a) What is the position of 43?
b) What is the result of x [2][3] +x [1][2]?
ii) Display the output: [2
String s="NICe";
char ch;
for(int i=0;i<4;i++)
{
ch=s.charAt(i);
if("AEIOUaeiou".indexOf(ch)>=0)
System.out.print("@");
else
PVM/Pre Board/ Computer Applications /2024-25/Page- 4
System.out.print(ch); }
iii) Consider the array: int a[ ] = {12,35,40,22,56,9,70}; [2
a) In the above array, using Linear search, how many iterations are required to
check for the existence of the value 56?
b) If the array is arranged in descending order, how many iterations are required
to check for the existence of 56 using Linear Search?
iv) Shantanu wants to display only the alphabets stored in a character array. While
compiling the code, an error was displayed. Check for the statement with the
error and write the correct statement- [2
char arr[ ]={‘4’,’&’,’a’,’w’,’d’}
for(int i=0;i<arr.length;i++)
{
If(Character.isLetter(arr))
System.out.println(arr);
}
v) a) Keyword that causes the control to transfer back to method call- [2
b) Keyword that distinguishes between class variable and instance variable-
vi) What is the data type that the following library functions return? [2
a) isWhiteSpace(char ch) b) Math.random()
vii) Display the output: [2
int a=10;
for (int i=1;i<=5;i++)
{
System.out.println(i+a+1);
if (i%2==0 && a%2==0)
break;
}
viii) Display the output: [2
int a[ ]={-1,-2,-3,-4,-5};
for(int i=0;i<5;i++)
{
System.out.println(Math. pow(a[i],2) + ++i);
}
ix) Display the output: [2
String x=” Galaxy”, y=” Games”;
a) System.out.println(x. charAt(0) ==y.charAt(0));
b) System.out.println(x.compareTo(y));
x) Rewrite the following do…. while program segment using for. [2
x=10; y=20;
do { x++;
y++;
} while(x<=20);
System.out.println(x*y);
PVM/Pre Board/ Computer Applications /2024-25/Page- 5
SECTION –B [60 Marks]
Attempt any four questions from this Section.
Each program should be written using variable description so that the logic of the program
is clearly depicted.
Question 3 [15
Design a class RailwayTicket with the following description:
Instance variables/data members:
String name :to store the name of the customer
String coach :to store the type of coach in which the customer wants to travel
long mobn :to store customer’s mobile number
int amt :to store basic amount of ticket
int tamt :to store the amount to be paid after updating the original amount
Member methods:
void accept () : to take input for name, coach, mobile number and amount
void update () : to update the amount per the coach selected (extra amount to be
added in the amount as follows:
Type of coaches Amount
First_AC Rs. 700/-
Second_AC Rs. 500/-
Third_AC Rs. 250/-
Sleeper None
void display () :to display all details of a customer such as name, coach, total amount
and mobile number
Write a main method to create an object of the class and call the above member methods.
Question 4 [15
Write a program to accept a string and insert a string into this given string at a particular
index number.
Sample Input : Do wait for opportunity. Create it.
Enter the string to be inserted : not
Enter the index number :2
Output : Do not wait for the opportunity. Create it
Question 5 [15
Write a program to search for an integer value input by the user in the sorted list given
below using binary search technique. If found display “Search Successful” and print the
element, otherwise display “Search Unsuccessful”.
{31,36,45,50,60,75,86,90}
PVM/Pre Board/ Computer Applications /2024-25/Page- 6
Question 6
Write a program to input elements in a matrix of 4x4 order and display sum of all the
elements except diagonal elements. [15
If the matrix is:
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
Output will be: Sum of all the elements except diagonal=68
Question 7
Design a class overload a function sumseries() as follows: [15
i) void sumseries(int n,double x)with integer argument and double argument to find
and display the sum of the series given ahead:
𝑥! (𝑥+2)! (𝑥+4)!
+ + +……………………..n terms
10 15! 20!
ii) void sumseries() : to find and display the sum of the series given below :
1 1 1 1 1
+ + + +⋯
1 1+2 1+2+3 1+2+3+4 1 + 2 + 3 + ⋯ . .10
Question 8 [15
A balanced number is a number whose sum of even digits is equal to the sum of odd digits.
Eg: 1254
Sum of even digits :2+4=6
Sum of odd digits :1+5=6
Therefore,1254 is a balanced number.
Write a program to generate and print all the balanced numbers between 1000 and 2000.