0% found this document useful (0 votes)
38 views5 pages

Computer X Prelims 24-25

The document outlines the Pre-board Examination for Class X in Computer Application at Raymond Memorial Higher Secondary School for the academic year 2024-2025. It includes instructions for candidates, a compulsory Section A with multiple-choice questions, and Section B with programming tasks and class definitions. The total marks for the exam are 100, with a time allocation of 2 hours plus 15 minutes for reading the paper.

Uploaded by

Avishek Bhadra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views5 pages

Computer X Prelims 24-25

The document outlines the Pre-board Examination for Class X in Computer Application at Raymond Memorial Higher Secondary School for the academic year 2024-2025. It includes instructions for candidates, a compulsory Section A with multiple-choice questions, and Section B with programming tasks and class definitions. The total marks for the exam are 100, with a time allocation of 2 hours plus 15 minutes for reading the paper.

Uploaded by

Avishek Bhadra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Raymond Memorial Higher Secondary School

Pre-board Examination 2024-2025


********************************************************
Class – X Total marks- 100
Subject- Computer Application Time- 2 Hours
********************************************************
<Candidates are allowed additional 15 minutes for only reading the paper.
They must NOT start writing during this time. >
Answer all the questions from the Section A (compulsory) and four questions
from Section B.
The intended marks for questions are given in brackets []
Section - A (Compulsory) [40 Marks]
Question no 1. [20x1=20]
i. Which of the following is a composite data type?
a) Class b) Array c) String d) All of the above

ii. What will be the output of the following code: “Apple”.compareTo(“apple”)?


a) 32 b) 0 c) -32 d) null

iii. Searching algorithm can be applied for which of the following types?
a) int b) char c) String d) All of the above

iv. Which of the following keyword is used to stop the execution of any program segment?
a) continue b) stop c) break d)System.exit(0);

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


String colors[]={‘RED’,’BLUE’,’GREEN’,’YELLOW’};
a) BLUE b) GREEN c) YELLOW d) Error

vi. Which of the following function converts an integer to a String?


a) 9.0 b) 8.0 c) 8 d) 9

vii. Which of these method of class String is used to compare two String objects for their equality?
a) equals() b) Equals() c) isequal() d) Isequal()

viii. Which of the following declarations are valid?


1) double d=1.2d; 2) double d=1.2D; 3) double d=1.2ds; 4) double d=1.2double;
a) 1 and 2 b) 1 and 3 c) 1,2 and 3 d) All 4

ix. Which of these data type value is returned by equals() method of String class?
a) String b) int c) Boolean d) all of the mentioned

x. Identify the correct array declaration statement:


a) int a[10]; b) int a[]=new int[10]; c) int arr[i]=10; d) int a[10]=new int[];

xi. A sub class inherits in a class is defined by?


a) Next class b) Super class c) Child class d) None of these
xii. Which of the following gets invoked when a new object of the class is created?
a) Class b) Function c) Constructor d) Variable

xiii. A variable that is bounded to the class itself is called as:


a) Instance variable b) class variable c) Local variable d) Argument variable

xiv. Which of the following is a literal?


a) new b) class c) sample() d) true

xv. Assertion (A): Integer class can be used in the program without calling a package.
Reason (R): It belongs to the default package java.lang.
(a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A)
(b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion (A)
(c) Assertion (A) is true and Reason (R) is false
(d) Assertion (A) is false and Reason (R) is true

xvi. The access modifier that gives least accessibility is:


a) private b) public c) protected d) package

xvii. The keyword to make a variable as a class variable


a) static b) Static c) final d) dynamic

xviii. Assertion (A): An argument is a value that is passed to a method when it is called.
Reason (R): Variables which are declared in a method prototype to receive values are called actual
parameters.
(a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A)
(b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion (A)
(c) Assertion (A) is true and Reason (R) is false
(d) Assertion (A) is false and Reason (R) is true

xix. What will be the output of the following Snippet?


String s = "Hello World";
int i = s.indexOf('o');
int j = s.lastIndexOf('l');
System.out.print(i + " " + j);
a) 4 8 b) 5 9 c) 4 9 d) 5 8

xx. Which will be the function returns when there is no occurrence of the char passed to indexOf() function?
a) 0 b) 1 c) -1 d) null

Question no 2. [10x2=20]

i) What is the output produced by the following lines of program code?


char x, y;
x = 'y';
System.out.println(x);
y = 'z';
System.out.println(y);
x = y;
System.out.println(x);

ii) Write the output of the following statement:


System.out.println("A picture is worth \t \"A thousand words.\" ");
iii) Give the output of the following program segment and also mention the no of times loop is going to execute:
for(int x=1; x<=n; x++)
if(n%x == 0)
System. out.println(x);
When the value of n is 12.

iv) State the output of the following program segment.


while( a != b)
{
if ( a > b)
a = a-b;
else
a = b-a;
}
System.out.println(a);
When the value of a is 4 and b is 17.

v) Rewrite the following program segment using while instead of for statement
int f = 1, i;
for (i = 1; i <= 5; i++) {
f *= i;
System.out.println(f);
}

vi) Consider the given array and answer the questions given below:
int x[] = {4,7,9,66,72,0,16};
(a) What is the length of the array?
(b) What is the value in x[4]?

vii) Sam executes the following program segment and the answer displayed is zero irrespective of any non zero
values are given. Name the error. How the program can be modified to get the correct answer?
void triangle(double b, double h)
{
double a; a = ½ * b * h;
System.out.println(“Area=”+a);
}

viii) Give the output of the following program segment:

int a,b;
for (a=1; a<=2; a++)
{
for (b= (64+a); b<=70; b++)
System.out.print((char) b);
System.out.println( );
}ix) Write the output for the following:

int p = 9;
while (p<=15)
{
p++;
if(p== 10)
continue;
System.out.println(p);
}

x) Write correctly the following statement:


String S = ["A", "E", "I", "O", "U"];

Section - B (Any Four)


(Marks – 15x4=60)
Question no 3.

Define a class Electric_Bill with the following specifications:


Classname: Electric_Bill
Instance Variable/ data member:
String n – to store the name of the customer
int units – to store the number of units consumed
int bill – to store the amount to paid
Member methods:
Electric_Bill() – Default constructor to initialize data members with legal initial value
void accept() – to accept the name of the customer and number of units consumed
void calculate() – to calculate the bill as per the following tariff :
Number of units — Rate per unit
First 100 units — Rs.4
Next 200 units — Rs.6
Above 300 units — Rs.8
A surcharge of 250 charged if the number of units consumed is above 300 units.
void print() – To print the details as follows :
Name of the customer ………
Number of units consumed ……
Bill amount …….
Write a main method to create an object of the class and call the above member methods.

Question no 4.
Write a program to input a number and check whether it is 'Disarium Number' or not. Display the
message accordingly.
DISARIUM: A number will be called DISARIUM if sum of its digits powered with their respective position is
equal to the original number.

For example 135 is a DISARIUM

(Workings 11 +32 +53= 135, some other DISARIUM are 89, 175, 518 etc)

Question no 5.

Write a Java program to input a sentence from the user in lowercase and capitalize the first and the last
characters of every word in it.
Sample Input: i love java for school.
Sample Output: I LovE JavA FoR SchooL
Question no 6.

Write a program to take twenty double value in a SDA.Now, Sort and display them in descending order using
the bubble sort technique.
Question no 7.

Design a class to overload the method display(.....) as follows:

1. void display(String str, char ch) — checks whether the word str contains the letter ch at the
beginning as well as at the end or not. If present, print 'Special Word' otherwise print 'No special
word'.
2. void display(String str1, String str2) — checks and prints whether both the words are equal or not.
3. void display(String str, int n) — prints the character present at n th position in the word str.

Question no 8.

Write a program to accept the year of graduation from school as an integer value from the user. Using the
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".
Sample Input:

int year[]={1982,1985,1987,1989,1992,1993,1994,1997,1999,2000};

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

ALL THE BEST


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

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