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

Mock 1

This document outlines the structure and requirements for a Class X Computer Applications theory exam. It includes two sections: Section A, which consists of mandatory questions worth 40 marks, and Section B, where students must answer any four questions worth 60 marks. The questions cover various programming concepts, including object-oriented programming, algorithms, and Java programming tasks.

Uploaded by

anushara26
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Mock 1

This document outlines the structure and requirements for a Class X Computer Applications theory exam. It includes two sections: Section A, which consists of mandatory questions worth 40 marks, and Section B, where students must answer any four questions worth 60 marks. The questions cover various programming concepts, including object-oriented programming, algorithms, and Java programming tasks.

Uploaded by

anushara26
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Class – X

Subject – Computer Applications

(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 the answers.

This paper is divided into two sections.

You are to answer 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 ( 40 Marks )

Attempt all questions.

QUESTION 1:

a. How are objects implemented in software terms? [2]


b. Define class. [2]
c. float num=1230.0008999f; [2]
How does the compiler handle the above statement?
d. What is dynamic initialization? Give an example. [2]
e. Write an equivalent java expression: [2]

QUESTION 2:

a. Write the features of BlueJ environment. [2]


b. What will be the value of variable Tax [2]
int Tax=(amt>100000) ?( 5*amt)/100 : 0 ;
if i) amt=50000 ii) amt=150000
c. Write how many times the following loop gets executed [2]
int i=15,f=1;
do{
f=f*i;
i++;
} while(i<=25);

d. Differentiate between functions and constructors. [2]


e. What is a default constructor? Give an example. [2]

QUESTION 3:

a. Rewrite the given statement using ternary operator [2]


if (a!=b)
p=(a-b);
else
p=b-a;
b. Differentiate Syntax error and logical error. [2]
c. Rewrite the following using while loop [2]
for(i=1;j=1;i<=10;i++;j++)
{
System.out.println(i*j);
}

d. What are temporary instances of a class? [2]


e. Write the syntax of PrintWriter class. Give an example to create its object. [2]
f. In a derived class, in private visibility the public and the protected members remain in the
same form. State and explain whether the above statement is true or false. [2]
g. Write the output of the following: [2]
String n=”Computer knowledge”;
String m=”computer application”;
System.out.println(n.substring(0,8).concat(m.substring(9)));
System.out.println(n.endsWith(“e”);
h. What will be the output of the following: [2]
System.out.println(“delhi”.compareTo(“DELHI”));
String a=”10”,b=”25”,c=0;
c=a+b;
System.out.println( c );
i. Rewrite using if construct: [2]
boolean b=(“computer”.length()>”application”.length())?true:false;
j. Differentiate between linear search and binary search. [2]
SECTION-B (60 Marks)

Answer any four questions from this Section .

Each program should be written in such a way that it clearly depicts the logic of the problem.

This should be achieved by using mnemonics and comments in the program.

Give the variable list used in the program. Flowcharts and algorithms not required

QUESTION 5: [15]

Write a program to input the length of the integer array as well as its elements in ascending order
from the user . Input the number to be searched. Perform binary search on the array.

QUESTION 6: [15]

Write a program in java to accept two words and check whether they are anagrams or not.

Anagram: A word that is made with the combination of the letters present in the original word.

Ex: FLOW and WOLF are anagrams, as the second word is made by rearranging the letters of the
first word.

QUESTION 7: [15]

Write a program in java using a class with the following specifications:

Class name: stringopr

Data members : private String s;

Member functions:

Stringopr(String x): constructor to initialize string s with x

int len(String p) : to find length of the string p

int numberofwords( ) : to find and display the number of words in the string

QUESTION 8: [15]

Write a menu driven program to generate the following :


i) Pattern:
55555
4444
333
22
1

ii) Series:
1, 11, 111, 1111, ……………… till the 6th element of the series

QUESTION 9: [15]

Define a class employee to input name , pan no, and salary of the employee. Calculate the tax
payable using the data given below

Salary Tax rate


Up to one lakh No tax
Between 1,00,001 to 1,50,000 10% on the income exceeding 1,00,000
Between 1,50,001 to 2,50,000 20% on the income exceeding 1,50,000
2,50,001 and above 30% on the income exceeding 2,50,000

Output must be displayed as per the given format

PAN NO NAME SALARY TAX

-------- --------- -------- -------

QUESTION 10: [15]

Write program using function overloading called to perform the following operations., to

i) input a number and display its absolute value


ii) input two integers and find the smallest number
iii) Input three decimal number find their product

You might also like