0% found this document useful (0 votes)
82 views11 pages

Class 12 Isc Practical File Questions

The document outlines a series of programming tasks for a Computer Science practical file for the academic year 2025-2026. Each question involves writing programs to solve specific problems, such as identifying Goldbach numbers, manipulating matrices, implementing a Caesar cipher, and checking for anagrams, among others. The document includes examples of inputs and expected outputs for each task to guide the implementation.

Uploaded by

basaksayan234
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)
82 views11 pages

Class 12 Isc Practical File Questions

The document outlines a series of programming tasks for a Computer Science practical file for the academic year 2025-2026. Each question involves writing programs to solve specific problems, such as identifying Goldbach numbers, manipulating matrices, implementing a Caesar cipher, and checking for anagrams, among others. The document includes examples of inputs and expected outputs for each task to guide the implementation.

Uploaded by

basaksayan234
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/ 11

COMPUTER SCIENCE PRACTICAL FILE PROGRAMS

(2025-2026)

Question 1
A number is said to be a Goldbach number, if the number can be expressed as the addition oftwo
odd prime number pairs. If we follow the above condition, then we can find that every even
number larger than 4 is a Goldbach number because it must have any pair of odd primenumber
pairs.
Example: 6 = 3,3 ( ONE PAIR OF ODD PRIME )
10 = 3,7 and 5 , 5 ( TWO PAIRS OF ODD PRIME )
Write a program to enter any positive EVEN natural number ‘N’ where (1<=N<=50) and
generate odd prime twin of ‘N’
Test your program for the following data and some random data.

Example 1
INPUT: N = 14
OUTPUT: ODD PRIME PAIRS ARE: 3, 11
7, 7
Example 2
INPUT: N = 20
OUTPUT: ODD PRIME PAIRS ARE: 17, 3
13, 7
Example 3
INPUT: N = 44
OUTPUT: ODD PRIME PAIRS ARE: 41, 3
37, 7
31, 13
Example 4
INPUT: N = 25
OUTPUT: INVALID INPUT

Question 2
Write a program to declare a matrix A [ ] [ ] of order (M × N) where ‘M’ is the number of rows
and ‘N’ is the number of columns such that both M and N must be greater than 2 and less
than10. Allow the user to input integers into this matrix. Display appropriate error message for
an invalid input. Perform the following tasks on the matrix.
Display the input matrix
Shift each row one step upwards so the first row will become the last row 2nd row will be the
1st row and so on
Display the rotated matrix along with the highest element and its location in the matrixTest your
program for the following data and some random data:
Example 1
INPUT: M =3
N=4
Enter elements in the matrix:

100 90 87 76
200 500 167 998
77 567 89 254
OUTPUT: FORMED MATRIX AFTER ROTATING:

200 500 167 998


77 567 89 254
100 90 87 76
Highest element: 998 ( Row: 0 and Column: 3 )
Example 2
INPUT: M =4
N=3
Enter elements in the matrix:

54 120 187
78 55 289
134 67 89
63 341 122
OUTPUT: FORMED MATRIX AFTER ROTATING:

78 55 289
134 67 89
63 341 122
54 120 187
Highest element: 341 ( Row: 2 and Column: 1 )
Example 3
INPUT: M = 2N = 3
OUTPUT: SIZE IS OUT OF RANGE. INVALID ENTRY

Question 3
Most (NOT ALL) cell phone keypads look like the following arrangement (the letters are above
the respective number)

ABC2 DEF3
1

GHI4 JKL5 MNO6

PQRS7 TUV8 WXYZ9

[SPACE]0

For sending text / SMS the common problem is the number of keystrokes to type a particulartext.

For example, the word "STOP", there are a total of 9 keystrokes needed to type the word. You
need to press the key 7 four times, the key 8 once, the key 6 three times and the key 7 once to
get it.

Develop a program code to find the number of keystrokes needed to type the text.

For this problem, accept just one word without any punctuation marks, numbers or white spaces
and the text message would consist of just 1 word.

Test your data with the sample data and some random data :

Example 1:

INPUT: DEAR

OUTPUT: Number of keystrokes = 7

Example 2:

INPUT: Thanks

OUTPUT: Number of keystrokes = 12

Example 3:

INPUT: Good-Bye

OUTPUT: INVALID ENTRY

Question 4
Write a program to accept a sentence which may be terminated by either ‘.’, ‘?’ or ‘!’ only. The
words are to be separated by a single blank space and are in uppercase. Perform the following
tasks:
(a) Check for the validity of the accepted sentence.
(b) Convert the non-palindrome words of the sentence into palindrome words by concatenating the
word by its reverse (excluding the last character).
Example: The reverse of the word HELP would be LEH (omitting the last alphabet) and by
concatenating both, the new palindrome word is HELPLEH. Thus, the word HELP becomes
HELPLEH. Note: The words which end with repeated alphabets, for example ABB would become
ABBA and not ABBBA and XAZZZ becomes XAZZZAX.
[Palindrome word: Spells same from either side. Example: DAD, MADAM etc.]
(c) Display the original sentence along with the converted sentence.
Test your program for the following data and some random data:
Example 1
INPUT:
THE BIRD IS FLYING.
OUTPUT:
THE BIRD IS FLYING.
THEHT BIRDRIB ISI FLYINGNIYLF
Example 2
INPUT:
IS THE WATER LEVEL RISING?
OUTPUT:
IS THE WATER LEVEL RISING?
ISI THEHT WATERETAW LEVEL RISINGNISIR
Example 3
INPUT:
THIS MOBILE APP LOOKS FINE.
OUTPUT:
THIS MOBILE APP LOOKS FINE.
THISIHT MOBILELIBOM APPA LOOKSKOOL FINENIF
Example 3
INPUT:
YOU MUST BE CRAZY#
OUTPUT:
INVALID INPUT

Question 5
The names of the teams participating in a competition should be displayed on a banner vertically,
to accommodate as many teams as possible in a single banner. Design a program to accept the
names of N teams, where 2 < N < 9 and display them in vertical order, side by side with a
horizontal tab (i.e. eight spaces).
Test your program for the following data and some random data:
Example 1
INPUT:
N=3
Team 1: Emus
Team 2: Road Rols
Team 3: Coyote
OUTPUT:
E R C
m o o
u a y
s d o
t
R e
o
l
s
Example 2
INPUT:
N=4
Team 1: Royal
Team 2: Mars
Team 3: De Rose
Team 4: Kings
OUTPUT:
R M D K
o a e i
y r n
a s R g
l o s
s
e
Example 3
INPUT:
N = 10
OUTPUT:
INVALID INPUT
Question 6
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
10. Accept the value of M as user input. Display an appropriate message for an invalid input.
Allow the user to input integers into this matrix. Perform the following tasks:
(a) Display the original matrix.
(b) Check if the given matrix is Symmetric or not.
A square matrix is said to be Symmetric, if the element of the (i)th row and (j)th column is
equal to the element of the (i)th row and (j)th column.
(c) Find the sum of the elements of left diagonal and the sum of the elements of right
diagonal of the matrix and display them.
Test your program with the sample data and some random data:
Example 1
INPUT : M=3
1 2 3
2 4 5
3 5 6
OUTPUT :
ORIGINAL MATRIX
1 2 3
2 4 5
3 5 6
THE GIVEN MATRIX IS SYMMETRIC
The sum of the left diagonal = 11
The sum of the right diagonal = 10
Example 2
INPUT : M=4
7 8 9 2
4 5 6 3
8 5 3 1
7 6 4 2

OUTPUT :
ORIGINAL MATRIX
7 8 9 2
4 5 6 3
8 5 3 1
7 6 4 2
THE GIVEN MATRIX IS NOT SYMMETRIC
The sum of the left diagonal = 17
The sum of the right diagonal = 20
Example 3
INPUT : M = 22
OUTPUT : THE MATRIX SIZE IS OUT OF RANGE
Question 7
Caesar Cipher is an encryption technique which is implemented as ROT13 ('rotate by 13
places'). It is a simple letter substitution cipher that replaces a letter with the letter 13
places after it in the alphabets, with the other characters remaining unchanged.
ROT13

A/a B/b C/c D/d E/e F/f G/g H/h I/i J/j K/k L/l M/m

↕ ↕ ↕ ↕ ↕ ↕ ↕ ↕ ↕ ↕ ↕ ↕ ↕

N/n O/o P/p Q/q R/r S/s T/t U/u V/v W/w X/x Y/y Z/z

Write a program to accept a plain text of length L, where L must be greater than 3 and less
than 100.
Encrypt the text if valid as per the Caesar Cipher.
Test your program with the sample data and some random data.
Example 1
INPUT:
Hello! How are you?
OUTPUT:
The cipher text is:
Uryyb! Ubj ner lbh?
Example 2
INPUT:
Encryption helps to secure data.
OUTPUT:
The cipher text is:
Rapelcgvba urycf gb frpher qngn.
Example 3
INPUT:
You
OUTPUT:
INVALID LENGTH

Question 8
A square matrix is the matrix in which number of rows is equal to number of columns. Thus, a
matrix of order n*n is called a Square Matrix. Write a program to fill the numbers in a circular
fashion(clockwise) with natural numbers from 1 to n 2, taking n as an input.
For example, if n=4, then n2=16, then the array is filled as:
Question 9
Given the two positive integers p and q, where p < q and both p and q should be less than 5000.
Write a program to determine how many kaprekar numbers are there in the range between ‘p’
and ‘q'(both inclusive) and output them.
A positive whole number ‘n’ that has ‘d’ number of digits is squared and split into 2 pieces, a
right hand piece that has ‘d’ digits and a left hand piece that has remaining ‘d’ or ‘d-1’ digits. If
sum of the pieces is equal to the number then it’s a kaprekar number.
SAMPLE DATA:
INPUT:
p=1
Q=1000
OUTPUT:
THE KAPREKAR NUMBERS ARE:
1, 9, 45, 55, 99, 297, 999

Question 10
Write a program to declare a matrix A [][] of order (MXN) where ‘M’ is the number of rows
and ‘N’ is the number of columns such that both M and N must be greater than 2 and less
than 20. Allow the user to input integers into this matrix. Perform the following tasks on the
matrix:
a) Display the input matrix
b) Find the maximum and minimum value in the matrix and display them along with their
position.
c) Sort the elements of the matrix in ascending order using any standard sorting technique
and rearrange them in the matrix.
d) Output the rearranged matrix.
Test your program with the sample data and some random data:
Example 1.
INPUT:
M=3
N=4
Entered values: 8,7,9,3,-2,0,4,5,1,3,6,-4
OUTPUT:
Original matrix:
8 7 9 3
-2 0 4 5
1 3 6 -4
Largest Number: 9
Row: 0
Column: 2
Smallest Number: -4
Row=2
Column=3
Rearranged matrix:
-4 -2 0 1
3 3 4 5
6 7 8 9

Question 11
Write a program to check if a given string is an Anagram of another string. Two strings are
anagrams if they can be rearranged to form the same string. For example, "listen" and
"silent" are anagrams.

Accept two strings from the user and check if they are anagrams of each other. Ensure that
the comparison is case-insensitive and ignores spaces. Display an appropriate message based
on whether they are anagrams or not. If any of the strings contain invalid characters (e.g.,
numbers or special characters), generate an error message.

Test your program with the following data and some random data: Example 1
INPUT: Enter first string: Listen
Enter second string: Silent
OUTPUT: STRINGS ARE ANAGRAMS

Example 2

INPUT: Enter first string: Dormitory


Enter second string: Dirty room

OUTPUT: STRINGS ARE ANAGRAMS

Example 3

INPUT: Enter first string: Hello


Enter second string: World

OUTPUT: STRINGS ARE NOT ANAGRAMS

Example 4
INPUT: Enter first string: Test123
Enter second string: 321tset

OUTPUT: INVALID CHARACTERS IN STRING. INVALID INPUT


Question 12
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:
Find the number of words beginning and ending with a vowel.
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

Question 13
A Composite Magic number is a positive integer which is composite as well as a magic
number.
Composite number:
A composite number is a number that has more than two factors.
For example: 10
Factors are: 1, 2, 5, 10
Magic number:
A magic number is a number in which the eventual sum of the digits is equal to 1
For example: 28=2+8=10=1+0=1
Accept two positive integers m and n, where m is less than n as user input. Display the
number of Composite magic integers that are in the range between m and n (both inclusive)
and output them along with the frequency, in the format specified below.
Test your program with the sample data and some random data:
Example 1:
INPUT:
m = 10
n = 100
OUTPUT:
THE COMPOSITE MAGIC INTEGERS ARE:
10, 28, 46, 55, 64, 82, 91, 100
FREQUENCY OF COMPOSITE MAGIC INTEGERS IS: 8
Example 2:
INPUT:
m = 1200
n = 1300
OUTPUT:
THE COMPOSITE MAGIC INTEGERS ARE:
1207, 1216, 1225, 1234, 1243, 1252, 1261, 1270, 1288
FREQUENCY OF COMPOSITE MAGIC INTEGERS IS: 9
Example 3:
INPUT:
m = 120
n = 99
OUTPUT:
INVALID INPUT

Question 14
Write a program to accept a sentence which may be terminated by either ‘.’ or ‘?’ only. The
words are to be separated by a single blank space. Print an error message if the input does
not terminate with ‘.’ or ‘?’. You can assume that no word in the sentence exceeds 15
characters, so that you get a proper formatted output.
Perform the following tasks:
(i) Convert the first letter of each word to uppercase.
(ii) Find the number of vowels and consonants in each word and display them with proper
headings along with the words.
Test your program with the following inputs.
Example 1
INPUT: Intelligence plus character is education.
OUTPUT:
Intelligence Plus Character Is Education
Word Vowels Consonants
Intelligence 5 7
Plus 1 3
Character 3 6
Is 1 1
Education 5 4
Example 2
INPUT: God is great.
OUTPUT:
God is Great
Word Vowels Consonants
God 1 2
Is 1 1
Great 2 3
Example 3
INPUT: All the best!
OUTPUT:
Invalid Input.

Question 15
Design a program which accepts your date of birth in dd mm yyyy format. Check whether the date
entered is valid or not. If it is valid, display “VALID DATE”, also compute and display the day
number of the year for the date of birth. If it is invalid, display “INVALID DATE” and then
terminate the program.
Test your program for the given sample data and some random data.
Input:
Enter your date of birth in dd mm yyyy format
05
01
2010
Output:
VALID DATE
5
Input:
Enter your date of birth in dd mm yyyy format
03
04
2010
Output:
VALID DATE
93
Input:
Enter your date of birth in dd mm yyyy format
34
06
2010
Output:
INVALID DATE

The students should take a printout in A4 sheet of the following given below.
Instructions to be followed for making the practical file for boards:
Profile page
Index
For each program do the following:
a) Full Question
b) Algorithm
c) Source code in Java
d) VDT
e) Screenshot of the output in BlueJ terminal
Acknowledgement

You might also like