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

First Term Assessment Computer Applications: Bombay Scottish School, Mahim

The document outlines the first term assessment for Computer Applications for Grade 10 at Bombay Scottish School, Mahim, including details such as the date, maximum marks, and structure of the exam. It consists of two sections: Section A, which requires answers to all questions, and Section B, where students must attempt any four questions. The questions cover various topics in Java programming, including class design, function overloading, and error handling.

Uploaded by

neev
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)
16 views4 pages

First Term Assessment Computer Applications: Bombay Scottish School, Mahim

The document outlines the first term assessment for Computer Applications for Grade 10 at Bombay Scottish School, Mahim, including details such as the date, maximum marks, and structure of the exam. It consists of two sections: Section A, which requires answers to all questions, and Section B, where students must attempt any four questions. The questions cover various topics in Java programming, including class design, function overloading, and error handling.

Uploaded by

neev
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

Bombay Scottish School, Mahim

FIRST TERM ASSESSMENT


COMPUTER APPLICATIONS
Grade : 10 Max. Marks : 100
Date : 04.10.2019 No. of Questions : 09
Duration : 02 hours No. of Printed sides : 04
[Answers to this paper must be written on the paper provided separately.]
Attempt all questions from Section A and any four 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) Name a class that belongs to each one of the following packages: [2]
(i) util (ii) lang
(b) Differentiate between call by value and call by reference. [2]
(c) How many elements can be stored in the following declared array?
Write the number of bytes that will be reserved for the storage.
float mk[ ] [ ] =new float [2] [3]; [2]
(d) State the two differences between constructor and method. [2]
(e) Identify and name the following tokens: [2]
(i) private
(ii) ‘k‘
(iii) void
(iv) {}

Question 2
(a) Explain the syntax and use of the keyword return. [2]
(b) What is the significance of keyword static in a variable declaration
statement? What is the scope of this variable? [2]
(c) Write the prototype of a function check which takes two arguments,
a string and a character and returns an integer value. [2]
(d) Mention the cause of the following errors by giving an appropriate
example: [2]
(i) Syntax error
(ii) Runtime error
(e) ‘Class is called an object factory’, Explain. [2]

1
Question 3
(a) Write an appropriate and valid Java statement for defining the
following data values: [2]

2 4 6
b= 8 10 12
14 16 18

(b) Differentiate between break and System.exit(). [2]


(c) State the output of the following: [2]
char a[ ] [ ] = { {‘A‘,‘B‘},{‘Y‘, ‘Z‘}};
for(int i=a[0].length-1;i>=0; i--)
System.out.println(a[1][i]);

(d) Read the following code fragment and answer the questions given
below: [2]
class Test
{
int method1(int x, int y)
{
int grade;
double avg=(x+y)/5.0;
if(avg>=25)
grade=1;
else
grade=2;
return grade;
}
void method2()
{
Test obj = new Test();
int a=25,b=45;
int ans= obj.method1(a,b);
System.out.println(ans);
}
}
(i) Name the formal parameters
(ii) Name the actual parameters
(iii) Name the caller method
(iv) What is the output of the code?

(e) What is the difference between length( ) and length? [2]


(f) Predict the output of the following code fragment:
String s="BOOK";
char arr[ ] = { s.charAt(0),s.charAt(3)};
System.out.print(arr[0]+" "+arr[1]); [2]

2
(g) How do you differentiate between a default constructor and a non-
parameterized constructor? [2]
(h) What is the use of parseInt() method? Name the wrapper class that
it belongs to. [2]
(i) Given that, int y[ ]={ 1,3,7,9};
What would be returned by Math.max(y[1],Math.sqrt(y[3]))? [2]
(j) Name the function to perform the following: [2]
(i) To accept a string at run time
(ii) To find the greater of two strings

SECTION B (60 Marks)


Attempt any four questions from this section.
The answers in this section should consist of Java programs where each
program should include the variable list and brief comments.

Question 4 [15]
Design a class named ‘Student’ having the following details of a student:
Data members : int Rno (Roll number)
String name (name)
float m1 (Term 1 marks out of 100)
float m2 (Term 2 marks out of 100)
double avg (average of Term 1 and Term 2 marks)
Member methods:
void input() : To accept appropriate values for the member variables
void calculate() : To find average of the marks
void show() : To display the details of a student

Write main() method to create an object and call the above methods.

Question 5 [15]
Write a program to accept integers in a two dimensional array of size 3x3. Find
the sum of the squares of all elements in the leading(left) diagonal. Further,
find the total of each column. Print both the outputs with appropriate
messages.

Question 6 [15]
Design a class to overload a function chkStr( ) as follows:
void chkStr(String s, char ch) : To find and print the frequency of ch in s.
Example:
Input:
s= “PHYSIOLOGY“
ch=’O’
Output:
Frequency of ’O’ in “PHYSIOLOGY“ is 2

3
void chkStr(String w) : To print the reverse of the string w
Example:
Input :
w=“Reverse“
Output:
esreveR
void chkStr(String s1,String s2): To combine the two strings s1 and s2 with a
space between them and print the resultant string.
Example:
Input:
s1=“Hard“
s2=“Disk“
Output:
Hard Disk
Write main() method to create an object and call the above mentioned methods.

Question 7 [15]
Write a menu driven program to either print the number pattern or a letter
pattern as per user’s choice, in the following format:
1. 2.
55555 C
CL
4444
CLO
333
CLOU
22 CLOUD
1
Accept the desired input as per the choice made by user. For example, for
choice 1, accept n where n is any integer and print the numbers 1 to n, in the
given pattern and for choice 2, accept the string and print its letters in the
given pattern.

Question 8 [15]
Write a program to design a class named ‘BuzzNum’ with the following
specifications:
Class name : BuzzNum
Data members : int a
Member methods :
BuzzNum(int x) : Parameterized constructor to initialize member variable
void chkBuzz( ) : To check and print with an appropriate message, if the
number is a Buzz number or not

Write main() method to create an object and call the above methods.
Buzz number is a number which either ends with 7 or is divisible by 7. For
example, 127 is a Buzz number as it ends with 7.

You might also like