# ISC Practical Paper 2013

COMPUTER SCIENCE

Paper – 2

(PRACTICAL)

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

(Maximum Marks: 80)

————————————————————————————————————

As it is a practical examination the candidate is expected to do the following:

1. Write an algorithm for the selected problem. Algorithm should be expressed clearly using ay standard scheme such as pseudo code or in steps which are simple enough to be obviously computable.  
2. Write a program in JAVA language. The program should follow the algorithm and should be logically and syntactically correct. 
3. Document the program using mnemonic names / comments, identifying and clearly describing the choice of data types and meaning of variables. 
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. 
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. 
6. Viva-Voce on the Selected Problem.   

Solve any one of the following Problems:

Question 1.

An ISBN (International Standard Book Number) is a ten digit code which uniquely identifies a book.

The first nine digits represent the group, publisher and title of the book and the last digit is used to check whether ISBN is correct or not.

Each of the first nine digits of the code can take a value between 0 to 9. Sometimes it is necessary to make the last digit equal to ten. This is done by writing the last digit of the code as X.

To verify an ISBN, calculate 10 times the first digit, plus 9 times the second digit, plus 8 times the third digit and so on until we add 1 time the last digit. If the final number leaves no remainder while divided by 11, the code is a valid ISBN

For example:

0201103311=10*0+9*2+8*0+7*1+6*1+5*0+4*3+3*3+2*1+1*1=55

This is a valid ISBN

007462542X=10*0+9*0+8*7+7*4+6*6+5*2+4*5+3*4+2*2+1*10=176

This is a valid ISBN

Similarly 0112112425 is not a valid ISBN.

Test Data:

Input code: 0201530821

Output: Sum=99

Leaves no remainder – valid ISBN

Input code: 356680324

Output: Sum=invalid input

Input code: 0231428031

Output: Sum=122

Leaves remainder – invalid ISBN

Question 2:

Write a program to declare a square matrix A[][] of order (MXN) where ‘M’ is the number of rows and the number of columns. ‘M’ should be greater than 2 and less than 20. Allow user to enter integers into this matrix. Display appropriate error message for an invalid input. Perform the following tasks.

1.    Display the input matrix

2.    Create a mirror image of the inputted matrix.

3.    Display the mirror image matrix

Test Data:

Input: M=3

4  16  12

8   2  14

6   1   3

Output:

Original matrix

4  16  12

8   2  14

6   1   3

Mirror image matrix:

12  16  4

14  2    8

3   1    6

Input: M=22

Output: Size out of range

Question 3:

A palindrome is a word that may be read the same in either direction.

Accept a sentence in upper case which is terminated by either ‘.’  ,  ’,’  ,  ‘? ’ ,  ‘!’. Each word in the sentence is separated by a blank space.