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

Computer Science 2024 PDF

computer speciman paper 2025

Uploaded by

Piyush Sarswat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
267 views

Computer Science 2024 PDF

computer speciman paper 2025

Uploaded by

Piyush Sarswat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

COMPUTER SCIENCE

PAPER-2
PRACTICAL
(Maximum Marks:30)
Time allowed: Three Hours
(Candidates are allowed additional 15 minutes for only reading the paper)
They must NOT start writing during this time)
The total time to be spent on the Planning Session 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 for the Planning Session.
However, if candidate finish earlier, they are to be permitted to begin the Examination Session.

This paper consists of three problems from which candidates are required to attempt any one problem.
Candidates are expected to do the following
A. Planning Session:
1. Write an algorithm for the selected problem. [3 marks]
(Algorithm should be expressed clearly using any standard scheme such as pseudo code or in steps
which are simple enough to be obviously complete.)

2. Write a program in JAVA language. The program should follow the [7 marks]
algorithm and should be logically and syntactically correct. Document the program using mnemonic
names/comments, identifying and clearly describing the choice of data types and meaning of variable.

B. Examination Session:
1. Code/Type the program on the computer and get a printout (hard copy). [2 Marks]
Typically, this should be a program that complies and runs correctly.

2. Test run the program on the computer using the given sample data and [3 Marks]
get a printout of the output in the format specified in the problem.

Note: The candidate must not carry any stationery, items such as pen/pencil/ eraser to the Computer
Laboratory for the Examination Session.

Page 1 of 4
Question 1
A Goldbach number is a positive even integer that can be expressed as the sum of two odd primes.
Note: All even integer numbers greater than 4 are Goldbach numbers.

Example:
6=3+3
10 = 3 + 7
10 = 5 + 5
Hence, 6 has one odd prime pair 3 and 3. Similarly, 10 has two odd prime pairs, i.e. 3 and 7, 5 and 5.

Write a program to accept an even integer 'N' where N > 9 and N < 50. Find all the odd prime pairs whose
sum is equal to the number 'N'.

Test your program with the following data and some random data:

Example 1
INPUT:
N = 14
OUTPUT:
PRIME PAIRS ARE:
3, 11
7, 7

Example 2
INPUT:
N = 30
OUTPUT:
PRIME PAIRS ARE:
7, 23
11, 19
13, 17

Example 3
INPUT:
N = 17
OUTPUT:
INVALID INPUT. NUMBER IS ODD.

Example 4
INPUT:
N = 126
OUTPUT:
INVALID INPUT. NUMBER OUT OF RANGE.

Page 2 of 4
Question 2
Write a program to declare a square matrix M[][] of order ‘N’. Check if the matrix is a Doubly
Markov matrix or not. A matrix which satisfies the following conditions are Doubly Markov matrix

(i) All elements are greater than or equal to 0


(ii) Sum of each row is equal to 1.
(iii) Sum of each column is equal to 1.

Accept ‘N’ from the user where 3 <= N <= 9. Display an appropriate error message if ‘N’ is not in
the given range or the entered numbers are negative. Allow the user to create a matrix and check
whether the created matrix is a Doubly Markov matrix or not

Test your program for the following data and some random data:

Example 1
INPUT: N=3
Enter elements in the matrix: 0.5, 0.25, 0.25, 0.25, 0.75, 0.0, 0.25, 0.0, 0.75
OUTPUT: FORMED MATRIX
0.5 0.25 0.25
0.25 0.75 0.0
0.25 0.0 0.75
IT IS A DOUBLY MARKOV MATRIX

Example 2
INPUT: N=3
Enter elements in the matrix: 1.5, 3, 0.15, 0.25, 4, 1.0, 0.25, 1.0, 3
OUTPUT: FORMED MATRIX
1.5 3 0.15
0.25 4 1.0
0.25 1.0 3
IT IS NOT A DOUBLY MARKOV MATRIX

Example 3
INPUT: N=2
Enter elements in the matrix: 0.8, -4.0, 0.9, 3.5
OUTPUT: NEGATIVE NUMBERS ENTERED. INVALID ENTRY

Example 4
INPUT: N =12
OUTPUT: SIZE IS OUT OF RANGE. INVALID ENTRY

Page 3 of 4
Question 3
Write a program to accept a sentence which may be terminated by either '.', '?' or '!' only. The words may be
separated by more than one blank space and are in UPPER CASE.

Perform the following tasks:


1. Find the number of words beginning and ending with a vowel.
2. Place the words which begin and end with a vowel at the beginning, followed by the remaining words
as they occur in the sentence.

Test your program with the sample data and some random data:
Example 1
INPUT:
ANAMIKA AND SUSAN ARE NEVER GOING TO QUARREL ANYMORE.
OUTPUT:
NUMBER OF WORDS BEGINNING AND ENDING WITH A VOWEL = 3
ANAMIKA ARE ANYMORE AND SUSAN NEVER GOING TO QUARREL

Example 2
INPUT:
YOU MUST AIM TO BE A BETTER PERSON TOMORROW THAN YOU ARE TODAY.
OUTPUT:
NUMBER OF WORDS BEGINNING AND ENDING WITH A VOWEL = 2
A ARE YOU MUST AIM TO BE BETTER PERSON TOMORROW THAN YOU TODAY

Example 3
INPUT:
LOOK BEFORE YOU LEAP.
OUTPUT:
NUMBER OF WORDS BEGINNING AND ENDING WITH A VOWEL = 0
LOOK BEFORE YOU LEAP

Example 4
INPUT:
HOW ARE YOU@
OUTPUT:
INVALID INPUT

Page 4 of 4

You might also like