First Term Assessment Computer Applications: Section A Any Four Section B
First Term Assessment Computer Applications: Section A Any Four Section B
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[ ]
Question 2
(a) What is the range of values for byte and short data types? [2]
(b) Differentiate between implicit and explicit type conversion. [2]
(c) What is the role of the keyword break in a switch-case? [2]
(d) What is an exit-controlled loop? Support your answer with an
example. [2]
(e) Briefly explain the two OOP features:
Data Abstraction and Data Encapsulation. [2]
Question 3
(a) Using an example write a Java statement to explain declaration,
instantiation and initialization of an object. [2]
1
(b) Given int a =6, b = 3, c = 2 evaluate (Show the working)
a += a++ + ++b + ++c + b + c++; [2]
(c) Explain why sorting is required in Binary Search Technique. [2]
(d) What is the purpose of the return statement in a function? Is it
compulsory to write the return statement? Give reason for your
answer. [2]
(e) How many times will the following loop be executed?
int p = 100, q=5;
while(q<p)
{
q = p/q;
System.out.println(“p = “+p+” q = “ +q);
} [2]
(f) Predict the output for the given code snippet:
int a[] = {1,2,3,4,5,6,7,8,9,10} ;
int sum=0;
for(int i=0; i<a.length/2 ; i+=1)
sum = a[i] + a[5-i];
System.out.println(sum); [2]
2
(i) Write a function prototype for a function convert which accepts
an integer x and String s as parameter and returns a character
datatype. [2]
(j) Identify as syntax or logical error giving reasons: [2]
(i) Math.pow(12-2);
(ii) for(int i=1;i<=10;i++);
sum = sum + i;
Question 4
Write a menu driven program to accept a number from the user and
check whether it is a Neon number or Duck number based on user
choice.
[A number is said to be a Neon number if the sum of digits of square
of the number is equal to the number. For example, if the input
number is 9, its square is 9*9 = 81 and sum of the digits is 9. i.e. 9 is
a neon number.
A number is said to be a Duck number if any of the digits in the
number is a 0 (zero). For example, 607 is a Duck Number but 654 is
not.] [15]
Question 5
Write a program to accept the heights of 20 students. Arrange them in
height order starting with the tallest student using the bubble sort
technique. [15]
Question 6
Write a program to accept 20 numbers into an array and calculate the
sum of the even and odd numbers separately. Display as output the
sum of the even and odd numbers and the smallest even and odd
number in the array with appropriate messages. [15]
3
Question 7
A courier company charges for the transportation of parcels from Delhi to
Kolkata or vice versa as per the given tariff:
Weight Charge
Up to 10 kg Rs.20 per kg
For the next 15 kg Rs.10 per kg
For the next 15 kg Rs.8 per kg
More than 40 kg Rs.5 per kg
Write a program to accept from the user the name of content and
weight of the parcel and calculate the charge for transporting the
parcel. Display as output the name, weight and the charge for the
parcel. [15]
Question 8
Member methods:
void accept( ) : To accept the sentence from the user.
void calculate( ) : To count the number of alphabets or numbers in the
sentence.
void display( ) : To display the count of alphabets and numbers.
Write a main method to create an object of the class and call the above
methods. [15]
:ss/18.09.2017