0% found this document useful (0 votes)
167 views

ISC 2013 Computer Science Paper 2 Practical

The document provides instructions for a computer science practical examination. It describes 5 tasks to be completed as part of the exam: 1) write an algorithm, 2) write a program in Java, 3) document the program, 4) code/type the program and get a printout, and 5) test the program and get an output printout. It also provides 3 sample problems that can be solved as part of the exam.
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)
167 views

ISC 2013 Computer Science Paper 2 Practical

The document provides instructions for a computer science practical examination. It describes 5 tasks to be completed as part of the exam: 1) write an algorithm, 2) write a program in Java, 3) document the program, 4) code/type the program and get a printout, and 5) test the program and get an output printout. It also provides 3 sample problems that can be solved as part of the exam.
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

COMPUTER SCIENCE

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:

1. Write an algorithm for the selected problem.


(Algorithm should be expressed clearly using any standard scheme such as pseudo
code or in steps which are simple enough to be obviously computable.)

[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]

6. Viva-Voce on the Selected Problem.

[20]

1213-868 B

This Paper consists of 4 printed pages.


www.javaforschool.com

Turn over

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 and 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 and so on until we add 1 time the last digit. If the final number leaves no remainder when
divided by 11, the code is a valid ISBN.
For Example:
1.

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

LEAVES REMAINDER INVALID ISBN CODE

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

MIRROR IMAGE MATRIX


12
14
3

16
2
1

4
8
6

Example 2
INPUT

M = 22

OUTPUT

SIZE OUT OF RANGE

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)

Display the count of palindromic words in the sentence.

(b)

Display the palindromic words in the sentence.

Example of palindromic words:


MADAM, ARORA, NOON
Test your program with the sample data and some random data:
Example 1
INPUT

MOM AND DAD ARE COMING AT NOON.

OUTPUT

MOM DAD NOON


NUMBER OF PALINDROMIC WORDS : 3

Example 2
INPUT

NITIN ARORA USES LIRIL SOAP.

OUTPUT

NITIN ARORA LIRIL


NUMBER OF PALINDROMIC WORDS : 3

Example 3
INPUT

HOW ARE YOU?

OUTPUT

NO PALINDROMIC WORDS

4
1213-868 B

www.javaforschool.com

You might also like