ISC 2013 Computer Science Paper 2 Practical
ISC 2013 Computer Science Paper 2 Practical
Paper 2
(PRACTICAL)
(Reading Time: 15 minutes)
(Planning Session AND Examination Session: Three Hours)
-------------
The total time to be spent on the Planning and the Examination Session is Three hours.
After completing the Planning Session, the candidate may begin with the Examination Session.
A maximum of 90 minutes is permitted to begin the Examination Session.
However, if candidates finish earlier, they are to be permitted to begin the Examination Session.
(Maximum Marks: 80)
-------------
As it is a practical examination the candidate is expected to do the following:
[10]
2. Write a program in JAVA language. The program should follow the algorithm and
should be logically and syntactically correct.
[20]
3. Document the program using mnemonic names / comments, identifying and clearly
describing the choice of data types and meaning of variables.
[10]
4. Code / Type the program on the computer and get a printout (hard copy). Typically,
this should be a program that compiles and runs correctly.
[10]
5. Test run the program on the computer using the given sample data and get a printout
of the output in the format specified in the problem.
[20]
[20]
1213-868 B
Turn over
0201103311 = 10*0 + 9*2 + 8*0 + 7*1 + 6*1 + 5*0 + 4*3 + 3*3 + 2*1 + 1*1 = 55
Since 55 leaves no remainder when divided by 11, hence it is a valid ISBN.
2.
007462542X = 10*0 + 9*0 + 8*7 + 7*4 + 6*6 + 5*2 + 4*5 + 3*4 + 2*2 + 1*10 = 176
Since 176 leaves no remainder when divided by 11, hence it is a valid ISBN.
3.
0112112425 = 10*0 + 9*1 + 8*1 + 7*2 + 6*1 + 5*1 + 4*1 + 3*4 + 2*2 + 1*5 = 71
Since 71 leaves no remainder when divided by 11, hence it is not a valid ISBN.
Design a program to accept a ten digit code from the user. For an invalid input, display an
appropriate message. Verify the code for its validity in the format specified below:
Test your program with the sample data and some random data:
Example 1
INPUT CODE
0201530821
OUTPUT
SUM = 99
LEAVES NO REMAINDER VALID ISBN CODE
Example 2
INPUT CODE
035680324
OUTPUT
INVALID INPUT
INPUT CODE
0231428031
OUTPUT
SUM = 122
Example 3
2
1213-868 B
www.javaforschool.com
Question 2
Write a program to declare a square matrix A[ ] [ ] of order (M x M) where M is the number of
rows and the number of columns such that M must be greater than 2 and less than 20. Allow the
user to input integers into this matrix. Display appropriate error message for an invalid input.
Perform the following tasks:
(a) Display the input matrix.
(b) Create a mirror image matrix.
(c) Display the mirror image matrix.
Test your program with the sample data and some random data:
Example 1
INPUT
M=3
4
8
4
OUTPUT
16
2
1
12
14
3
ORIGINAL MATRIX
4
8
4
16
2
1
12
14
3
16
2
1
4
8
6
Example 2
INPUT
M = 22
OUTPUT
1213-868 B
3
www.javaforschool.com
Turn over
Question 3
A Palindrome is a word that may be read the same way in either direction.
Accept a sentence in UPPER CASE which is terminated by either . , ? or ! .
Each word of the sentence is separated by a single blank space.
Perform the following tasks:
(a)
(b)
OUTPUT
Example 2
INPUT
OUTPUT
Example 3
INPUT
OUTPUT
NO PALINDROMIC WORDS
4
1213-868 B
www.javaforschool.com