Isc 2025 Prac CMS

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

CENTRAL MODERN SCHOOL

SESSION: 2024-2025
______________________________________________________________________________
PRE BOARD EXAMINATION FOR ISC 2025
Computer Science (Paper 2)
CLASS - XII (PRACTICAL) Full marks:-30
Time :- 3 Hours
[PLANNING SESSION AND EXAMINATION SESSION: THREE HOURS]
The total time to be spent on the Planning Session and the Examination Session is Three hours.
PLANNING SESSION : 90 MINUTES. EXAMINATION SESSION : 90 MINUTES
Note : Candidates are to be permitted to proceed to the Examination Session only after 90 minutes
of the planning session are over. (MAXIMUM MARKS – 30)
1. Write an algorithm for the selected problem. [3]
(Algorithm should be expressed clearly using any 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 [7]
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 variables.
3. Code / Type the program on the computer and get a printout ( hard copy ). Typically, [2]
This should be a program that compiles and runs correctly.
4. Test run the program on the computer using the given sample data and get a printout of [3]
The output in the format specified in the problem.
[ In addition to the above, the practical file of the candidate containing the practical work
related to the programming assignments done before pre board examination ] [15 marks]
[ ATTEMPT ANY ONE PROBLEM]
Question 1
Hamming numbers are positive integer numbers whose prime factors include 2,3 and 5 only.
Example : N=6 is an hamming number as 6=2 * 3 . so its prime factors are limited to 2 , 3.
N=8 is an hamming number as 8=2*2*2 and it has only 2 as its prime factors.
N=90 is an hamming number as 90=2*3*3*5 which has only 2,3,5 as prime factors.
N=14 is not hamming number as 14=2*7. It has 7 as one of its prime factor.
N=44 is not hamming number as 44= 2*2*11. It has 11 as one of its prime factors.
Design a program to accept any positive integer number and check if it is Hamming number or not.
Display the result with an appropriate message if the format specified below. The program should also
generate error message if a negative number is entered.
Test your program for the following data and some random data.
Example 1 : INPUT : Enter any number :3600
OUTPUT : 3600=2*2*2*2*3*3*5*5 3600 IS AN HAMMING NUMBER
Example 2: INPUT : Enter any number : 5832
OUTPUT : 5832=2*2*2*3*3*3*3*3*3 5832 IS A HAMMING NUMBER
Example 3 : INPUT : Enter any number :7854
OUTPUT : 7854=2*3*7*11*17 7854 IS NOT A HAMMING NUMBER
Example 4: INPUT : Enter any number : -120
OUTPUT : NEGATIVE NUMBER ENTERED. INVALID INPUT

Page 1 of 3
CENTRAL MODERN SCHOOL

SESSION: 2024-2025
______________________________________________________________________________

Question 2
Write a program to accept a paragraph containing two sentence only. The sentences may be
terminated by either ‘.’ , ‘?’ or ‘!’ only. Any other character may be ignored. The words are to be
separated by a single blank space and must be in upper case.
Perform the following task:-
a) Check for the validity of the accepted paragraph for the number of sentences and for
the terminating character.
b) Separate the two sentences from the paragraph and find the common words in the two
sentences with their frequency of occurrence in the paragraph.
c) Display both the sentences separately along with the common words and their
frequency, in the format given below:
Test your program for the following data and some random data:
Example 1: INPUT: IS IT RAINING? YOU MAY GET WET IF IT IS RAINING.
OUTPUT : IS IT RAINING?
YOU MAY GET WET IF IT IS RAINING.

COMMON WORDS FREQUENCY


IS 2
IT 2
RAINING 2
Example 2: INPUT : INDIA IS MY MOTHERLAND AND I AM PROUD OF MY MOTHERLAND.
ALL INDIANS ARE MY BORTHERS AND SISTERS.
OUTPUT: INDIA IS MY MOTHERLAND AND I AM PROUD OF MY MOTHERLAND.
ALL INDIANS ARE MY BROTHERS AND SISTERS.
COMMON WORDS FREQUENCY
MY 3
AND 2
Example 3: INPUT : ARE YOU COMING? I AM GETTING LATE.
OUTPUT : ARE YOU COMING?
I AM GETTING LATE
NO COMMON WORDS
Example 4: INPUT: AT LAST, THE TIGER WAS SAVED.
OUTPUT : INVALID INPUT
Question 3
Write a program to declare a square matrix M[ ][ ] of order ’N’. Check if the matrix is Double Markov
or not. A matrix which satisfies the following conditions are Double 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.

Page 2 of 3
CENTRAL MODERN SCHOOL

SESSION: 2024-2025
______________________________________________________________________________

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 enter a matrix and check
whether matrix is a Double Markov matrix or not.

Test your program for the following 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 : FROMED MATRIX
0.50 0.25 0.25
0.25 0.75 0.0
0.25 0.0 0.75

IT IS A 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 : FROMED MATRIX
1.5 3 0.15
0.25 4 1.0
0.25 1.0 3
IT IS NOT A DOUBLE MARKOV MATRIX

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

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

Page 3 of 3

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy