Computer Applications MS - 2014
Computer Applications MS - 2014
September 2014
For further information and comments, please correspond with:
This document of the Analysis of Pupil Performance at the ICSE (Class-10) Examination is a unique tool for
retrospection for both, teachers and students. It has grown and evolved over the years to provide feedback to all
concerned in terms of the strengths and weaknesses of the candidates in handling the ICSE examinations.
We commend the work of Mr. Lancelot J Fuller, Deputy Secretary, and the ICSE Division of the Council who
have painstakingly prepared this analysis. We are grateful to the examiners who have contributed through their
comments on the performance of the candidates under examination as well as for their suggestions to teachers
and students for the effective transaction of the syllabus.
We hope the schools will find this document useful in more ways than one. We invite comments from schools
on further improving its utility and quality.
Gerry Arathoon
October 2014 Chief Executive & Secretary
The Council for the Indian School Certificate Examinations has published the “Analysis of Pupil Performance”
annually since 1994. This document is reviewed every year and changes are incorporated based on suggestions
received from various quarters which include experts in the field of education, Heads of Schools and teachers, in
order to make the analysis more useful and meaningful.
This document comprises both, a quantitative as well as a qualitative analysis of the performance of pupils at the
ICSE examinations. The Analysis of Pupil Performance has been carried out for the most studied subjects that
are largely ascribed to, by the schools. The purpose of this document is to give teachers and students a macro
view of the overall performance of all candidates who have taken the examination and examiners’ comments on
each question. It is hoped that this would enable teachers and students to understand the assessment of the ICSE
examinations better and help both, teachers and students, in the teaching – learning process, more effectively.
The qualitative analysis seeks to provide a transparent look at the assessment process in order to enhance the
effectiveness of the entire assessment procedure. Once the process of the evaluation of scripts is over, examiners
are requested to contribute detailed comments on the performance of candidates for each question. The
comments include the examiners’ response on what constitutes a good answer; common errors made by
candidates while answering the questions; the questions that appeal to students and the overall performance by
the students.
The quantitative analysis is based on the overall performance of all the students who took the examination. An
analysis of the percentage of students who obtained marks in different mark ranges is also included.
Mr. Richard Ellis, Mr. M.R. Felix, Mr. M. Gopal, Mr. C.M. Thomas, Mrs. Liza George and Mrs. Namita Bajaj
are to be commended for their meticulous and diligent effort in preparing this reference tool for both, teachers
and students.
Lancelot J Fuller
October 2014 Deputy Secretary
Mark Range
Details
0-20 21-40 41-60 61-80 81-100
Number of Candidates 2 73 6665 25943 56764
Percentage of Candidates 0.00 0.08 7.45 29.00 63.46
Cumulative Number 2 75 6740 32683 89447
Cumulative Percentage 0.00 0.08 7.54 36.54 100.00
70.00 63.46
Percentage of Candidates
60.00
50.00
40.00
29.00
30.00
20.00
7.45
10.00
0.00 0.08
0.00
0-20 21-40 41-60 61-80 81-100
Marks Obtained
226
ANALYSIS OF PERFORMANCE
Question 1
(b) What is meant by a package? Name any two Java Application Programming Interface
packages. [2]
(d) State one difference between the floating point literals float and double. [2]
(e) Find the errors in the given program segment and re-write the statements correctly to
assign values to an integer array.
int a = new int(5);
for(int i=0;i<=5;i++) a[i]=i; [2]
227
MARKING SCHEME
Question – 1
(a) (i)
(iii)
(b) A package is a group of related classes
Any two of the following:
java.applet java.sql javax.sound
java.awt java.text javax.swing
java.beans java.util javax.transaction
java.io javax.accessibility javax.xml
java.lang javax.crypto org.ietf
java.math javax.imageio org.omg
java.net javax.naming org.w3c
java.nio javax.net org.xml
java.rmi javax.print
java.security javax.rmi
(c) (i) long
(ii) char
228
Question 2
(a) Operators with higher precedence are evaluated before operators with relatively lower
precedence. Arrange the operators given below in order of higher precedence to lower
precedence.
(i) && (ii) % (iii) >= (iv) ++ [2]
(b) Identify the statements listed below as assignment, increment, method invocation or
object creation statements.
(i) System.out.println("Java");
(ii) costPrice = 457.50;
(iii) Car hybrid = new Car( );
(iv) petrolPrice++; [2]
(c) Give two differences between the switch statement and the if-else statement. [2]
(d) What is an infinite loop? Write an infinite loop statement. [2]
(e) What is a constructor? When is it invoked? [2]
229
MARKING SCHEME
Question - 2
(a) (iv), (ii), (iii), (i) All 4 correct
Only 1 incorrect
(b) (i) method invocation
(ii) assignment
(iii) object creation
(iv) increment All 4 correct
Only 1 incorrect
(c) switch:
can perform only equality (= =) comparison OR
can have a number of possible execution paths OR
works with the byte/short/char/int primitive data types OR
multiple branching OR
is used along with case statement OR default statement
If-else:
Can perform all relational comparisons (<, >, >=, <=, = =, !=) OR
executes a certain section of code only if a particular test evaluates to true OR
provides a secondary path of execution when an "if" clause evaluates to false OR
works with any data type OR conditional/control flow/decision statements
(d) A sequence of instructions which loops/iterates/repeats endlessly.
Any valid example which shows:
the loop having no terminating condition OR
230
(a) List the variables from those given below that are composite data types.
(i) static int x; (iv) boolean b;
(ii) arr[i]=10; (v) private char chr;
(iii) obj.display( ); (vi) String str; [2]
(b) State the output of the following program segment:
String str1= "great"; String str2= "minds";
System.out.println(str1.substring(0,2).concat(str2.substring(1)));
System.out.println(("WH"+(str1.substring(2).toUpperCase()))); [2]
(c) What are the final values stored in variables x and y below?
double a = − 6.35;
double b = 14.74;
double x = Math.abs(Math.ceil(a));
double y = Math.rint(Math.max(a,b)); [2]
(d) Rewrite the following program segment using if-else statements instead of the ternary
operator.
String grade=(mark>=90) ? "A" : (mark>=80) ? "B" : "C"; [2]
(e) Give the output of the following method:
public static void main(String[] args){
int a = 5;
a++;
System.out.println(a);
a−=(a−−) – (−−a);
System.out.println(a); } [2]
(f) What is the data type returned by the library functions:
231
232
233
MARKING SCHEME
Question - 3
(a) (ii) arr (iii) obj (vi) str All 3 correct
Any 2 correct
(b) grinds
WHEAT
( c) 6.0
15.0
(d) if(mark>=90) grade=”A”;
else if(mark>=80) grade=”B”;
else grade=”C”; All 3 correct
Any 2 correct
(e) 6
6−(6−4)=4
(f) (i) int
(ii) boolean
(g) 4
3756
(h) (i) 6 times
(ii) 0 to 9 OR {1,2,3,4,5,6,7,8,9}
(i) (i) a,b
(ii) x,y
(j) (i) x=1001
y=1001.0
(ii) The king said “Begin at the beginning!”to me.nextLine()
234
Write a main method to create an object of the class and call the above member methods. [15]
235
MARKING SCHEME
Question - 4
import java.io.*;//import java.util.*;
public class movieMagic
{
int year; float rating; String title;
public movieMagic()
{
year=0;
rating=0.0f;
title="";
}
do
{
System.out.println("Enter rating (minimum 0.0 and maximum 5.0)");
rating=Float.parseFloat(br.readLine()); // sc.nextInt();
}
while (!(rating>=0.0f && rating<=5.0.f)); OR while (rating < 0.0f rating
>5.0f );
}
object.accept();
object.display();
}
Step
Declaration of class and instance variables
Creating object of class BufferedReader/Scanner
Constructor properly declared and data members initialised
accept() method declaration (with exception handling if
required)
3 Inputs correct
Output title in display() method
Decision for rating<=2.0 and output
237
Question 5
A special two-digit number is such that when the sum of its digits is added to the product of its
digits, the result is equal to the original two-digit number.
Example: Consider the number 59.
Sum of digits = 5 + 9 = 14
Product of its digits = 5 × 9 = 45
Sum of the sum of digits and product of digits = 14 + 45 = 59
Write a program to accept a two-digit number. Add the sum of its digits to the product of its
digits. If the value is equal to the number input, output the message “Special 2-digit number”
otherwise, output the message “Not a special 2-digit number”. [15]
Examiners’ Comments:
Most candidates answered this question, but the Suggestions for teachers
- How to validate data should be taught
following errors were commonly observed:
with the help of examples.
(i) Checking for 2-digit number was missing.
- Extraction of digits logic n%=10 and
(ii) Extraction of digits using loop was not clear. n/=10 needs to be explained with
(iii) Candidates were confused in the use of numerous examples and exercises.
temporary variable for copying the original value - Why a copy of original value must be
in extraction of digits. maintained should be explained with a dry
run and which one to use where – if the
original is used in extraction loop then a
copy to be used in comparison or vice
versa.
238
Step
Input number
Initialise 2 sums and product
Store number in second variable
Check if number is 2-digit
condition for number >0 while(n>0)
Extract digit from number
Compute sum of digits
Compute product of digits
number/=10
Compute total of sum and product of digits
Check if total equals number
Output "Special Number" message
Output "Not Special Number" message
Description of variables/ comments/ mnemonics
239
digit1=Integer.parseInt(s1);
digit2=Integer.parseInt(s2);
sumDigit=digit1+digit2;
prodDigit=digit1*digit2;
sum=sumDigit+prodDigit;
if(sum==n)
System.out.println("Special Number");
else
System.out.println("Not a Special Number");
}
}
}
Step
Input number as String
Convert String to integer
Check if number is 2-digit
Extract first digit
Extract second digit
Convert first digit from String to integer
Convert second digit from String to integer
Compute sum of digits
Compute product of digits
Compute total of sum and product of digits
Check if total equals number
Output "Special Number" message
240
Question 6
Write a program to assign a full path and file name as given below. Using library functions, extract and
output the file path, file name and file extension separately as shown.
Input C:\Users\admin\Pictures\flower.jpg
Output Path: C:\Users\admin\Pictures\
File name: flower
Extension: jpg [15]
241
Step
Assign value to String (accept single slash instead of double slash)
Declare variables (ignore initialisation)
Find length of string
Loop
Extract character
Check if character is '.'
Extract substring for file extension
store position of '.'
Check if character is '//' (accept single slash instead of double slash)
Extract substring for file name
Extract substring for file path
break to exit loop
Output file path, file name, file extension
Description of variables/ comments/ mnemonics
OR
public class alternateSolution
{
public void sampleMethod()
{ String s="C:\\users\\admin\\pictures\\flower.jpg";
pos1=s.lastIndexOf('\\');
pos2=s.indexOf('.');
fpath=s.substring(0,pos1+1);
fname=s.substring(pos1+1, pos2);
242
System.out.println("Path: "+fpath);
System.out.println("Extension: "+fextn);
}
}
Step
Assign value to String (accept single slash instead of double slash)
Declare variables (ignore initialisation)
Find last index of slash (accept single slash instead of double slash)
Find index of '.'
Extract substring for file path
Extract substring for file name
Extract substring for file extension
Output file path
Output file name
Output file extension
Description of variables/ comments/ mnemonics
Question 7
Design a class to overload a function area( ) as follows:
(i) double area(double a, double b, double c) with three double arguments, returns the area
of a scalene triangle using the formula:
area = s ( s a)(s b)(s c)
abc
where s =
2
(ii) double area(int a, int b, int height) with three integer arguments, returns the area of a
trapezium using the formula:
1
area = height(a+b)
2
(iii) double area(double diagonal1, double diagonal2) with two double arguments, returns the
area of a rhombus using the formula:
243
MARKING SCHEME
Question - 7
public class overload
{
double area=0;
}
public double area(int a, int b, int height)
{
area=0.5*height*(a+b);
return area;
}
public double area(double diagonal1, double diagonal2)
{
double area=0.5*(diagonal1*diagonal2);
return area;
}
}
244
Question 8
Using the switch statement, write a menu driven program to calculate the maturity amount of
a Bank Deposit.
The user is given the following options:
(i) Term Deposit
(ii) Recurring Deposit
For option (i) accept principal(P), rate of interest(r) and time period in years(n). Calculate
n
r
and output the maturity amount(A) receivable using the formula A= P 1
100
For option (ii) accept Monthly Installment (P), rate of interest(r) and time period in months
(n). Calculate and output the maturity amount(A) receivable using the formula
n( n 1) r 1
A=P×n + P× × ×
2 100 12
For an incorrect option, an appropriate error message should be displayed. [15]
245
MARKING SCHEME
Question 8
import java.io.*; //import java.util.*;
public class bank
{ public void sampleMethod()throws IOException // throwsInputMismatchException
{ double P,A=0,r,n,x; int choice;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
//Scanner sc=new Scanner(System.in);
System.out.println("Enter Choice(1) Term Deposit (2) Recurring Deposit ");
choice=Integer.parseInt(br.readLine());//sc.nextInt();
switch(choice)
{
case 1:
System.out.println(" Enter Principal:");
P=Double.parseDouble(br.readLine());//sc.nextDouble();
System.out.println(" Enter rate of interest:"); r=Double.parseDouble(br.readLine());
System.out.println(" Enter time period in years:");
n=Double.parseDouble(br.readLine());//sc.nextDouble();
x=1.0+r/100.0;
A=P*(Math.pow(x,n));
break;
case 2:
System.out.println(" Enter Monthly Instalment:");
P=Double.parseDouble(br.readLine());//sc.nextDouble();
System.out.println(" Enter rate of interest:"); r=Double.parseDouble(br.readLine());
System.out.println(" Enter time period in months:");
n=Double.parseDouble(br.readLine());//sc.nextDouble();
x=P*n;
A=x+ P*(n*(n+1)/2.0)*(r/100.0)*(1.0/12.0);
246
Step
Output menu
Input option
switch statement
case 1 and break
Input 3 parameters (any data type)
Compute Amount for term deposit (ignore data types)
case 2 and break
Input 3 parameters (any data type)
Computing Amount for recurring deposit (ignore data types)
default statement with appropriate message
Output Amount (ignore formatting)
Description of variables/ comments/ mnemonics
Question 9
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”.
{1982, 1987, 1993, 1996, 1999, 2003, 2006, 2007, 2009, 2010} [15]
247
MARKING SCHEME
Question 9
import java.io.*; //import java.util.*;
public class BinarySearch {
public static void main() throws IOException
{ int[] intArray = {1982, 1987, 1993, 1996, 1999, 2003, 2006, 2007, 2009, 2010};
int searchValue = 0;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
//Scanner sc=new Scanner(System.in);
System.out.print("Enter a number to search for: ");
searchValue = Integer.parseInt(br.readLine());//sc.nextInt();
boolean b=false;
int start, end, mid;
start = 0;
end = intArray.length - 1; // end=9
while (start <= end) {
mid = (start + end) / 2;
if (intArray[mid] == searchValue)
1 mark
{ System.out.println("Record exists"); b=true; break;}
else if (intArray[mid] < searchValue)
start = mid + 1;
248
end = mid - 1;
}
if (b==false) System.out.println("Record does not exist");
}
}
Step
Assign (or accept) values to integer array
Input number to be searched
249
Computer Applications is a logic based subject like Mathematics and highly scoring in nature. It
needs to be given time of self-study revision and practice at least 3 times a week for a duration of ½
an hour each day followed by a complete review of week’s work during the week end. Do not leave
this subject to be studied on the eve of the examination.
All exercises, general and Programming to be maintained in a register and revised during exam
preparation.
Syntax of each element of Java to be thoroughly studied.
At the time of answering, every question must be read at least twice before answering.
All programs must be written with suitable comments – whether in class or during exam.
A good variable description containing a list of important variables used in the program along with
their data types and purpose must be given at the end of every program.
250