Is C 2026 Project Work
Is C 2026 Project Work
Question 1
An integer number whose digits are arranged in ascending order from left to right is called an
Increasing Number. At any position, the current digit is always greater than or equal to the previous
digit. For example, 1233, 13689, 112334566, etc.
An integer number whose digits are arranged in descending order from left to right is called a
Decreasing Number. Here the current digit is always less than or equal to the previous digit. For
example, 321, 88531, 8755321, etc.
A positive integer where the digits are neither in increasing nor decreasing order is called a Bouncy
number. In other words, if the digits of the number are unsorted then it is bouncy. For example,
123742, 101, 43682, etc.
Design a program to accept a number (containing only digits 0 to 9) from the user. For an invalid
input, display an appropriate message. Check whether the number is an increasing, decreasing or a
bouncy number and display with an appropriate message in the format specified below:
Test your program for the following data and some random data.
Example 1
INPUT: Enter a number: 122344
OUTPUT: 122344 IS AN INCREASING NUMBER:
Example 2
INPUT: Enter a number: 887552
OUTPUT: 887552 IS A DECREASING NUMBER
Example 3
INPUT: Enter a number: 185349
OUTPUT: 185349 IS A BOUNCY NUMBER
Example 4
INPUT: Enter a number: 98#57-649
OUTPUT: INVALID INPUT
Question 2
An encoded text can be decoded by finding actual character for the given ASCII code in the encoded
message. Write a program to input an encoded text having only sequence of ASCII values without
any spaces. Any code or value which is not in the range 65-90 (A – Z) or 97-122 (a – z) or 32 (for
space) will be ignored and should not appear in the output message.
Write a program to accept a CODE which contains only digits (0 to 9). Display an error message if
the code contains any other character/s.
Test your program for the following data and some random data:
Page 1 of 19
Don Bosco School Liluah
Example 1
INPUT: CODE: 10665771011153266797868
OUTPUT: James Bond
Example 2
INPUT: CODE: 667685693232837589
OUTPUT: Blue Sky
Example 3
INPUT: CODE: 22-768#5693232375889
OUTPUT: INVALID INPUT
Question 3
Write a program in JAVA to enter the date in (dd/mm/yyyy) format and day of the week on which a
project was given. If a college allots 90 days (including the project giving day) to complete the work,
then calculate the date on which the project is to be submitted along with the day name. If the final
submission day is SUNDAY then the students get one extra day and submits the project on the next
day that is MONDAY.
Also check the validity of the date entered and display your output in the format given below.
Test your program with the given sample data and some random data
Example 1
INPUT: ENTER PROJECT DATE: 1/9/2022
DAY OF THE WEEK: THURSDAY
OUTPUT: PROJECT SUBMISSION DATE: 29/11/2022
DAY OF THE WEEK: TUESDAY
Example 2
INPUT: ENTER PROJECT DATE: 25/11/2022
DAY OF THE WEEK: FRIDAY
OUTPUT: PROJECT SUBMISSION DATE: 22/02/2023
DAY OF THE WEEK: WEDNESDAY
Example 3
INPUT: ENTER PROJECT DATE: 28/6/2022
DAY OF THE WEEK: TUESDAY
OUTPUT: PROJECT SUBMISSION DATE: 26/9/2022
DAY OF THE WEEK: MONDAY
Example 4
INPUT: ENTER PROJECT DATE: 31/9/2022
DAY OF THE WEEK: THURSDAY
OUTPUT: INVALID DATE
Page 2 of 19
Don Bosco School Liluah
Question 4
Write a program to declare a square matrix M [ ] [ ] of order ‘N’ where ‘N’ must be greater than 3
and less than 10. Accept the value of N as user input. Display an appropriate message for an invalid
input. Allow the user to accept three different characters from the keyboard and fill the matrix
according to the instruction given below:
(i) Fill the four corners of the square matrix by character 1
(ii) Fill the boundary elements of the matrix (except the four corners) by character 2
(iii) Fill the non-boundary elements of the matrix by character 3
(iv) Display the matrix formed by the above instructions
Test your program for the following data and some random data:
Example 1
INPUT: N=3
Enter First Character: @
Enter Second Character: ?
Enter Third Character: #
OUTPUT: FORMED MATRIX
@ ? ? @
? # # ?
? # # ?
@ ? ? @
Example 2
INPUT: N=5
Enter First Character: A
Enter Second Character: C
Enter Third Character: X
OUTPUT: FORMED MATRIX
A C C C A
C X X X C
C X X X C
C X X X C
A C C C A
Example 3
INPUT: N = 12
OUTPUT: SIZE IS OUT OF RANGE
Question 5
Write a program to declare a square matrix M[ ] [ ] of order (N x N) where `N' must be greater than 3
and less than 10. Allow the user to input positive integers into this matrix. Perform the following
tasks on the matrix:
Page 3 of 19
Don Bosco School Liluah
(a) Sort the boundary elements in ascending order using any standard sorting technique and rearrange
them in the matrix in clockwise manner.
(b) Calculate the product of the non-boundary elements.
(c) Display the original matrix, rearranged matrix and only the non-boundary elements of the
rearranged matrix with their sum.
Test your program for the following data and some random data:
Example 1
INPUT: N=4
11 2 5 7
8 10 9 4
15 5 3 11
1 17 14 8
REARRANGED MATRIX
1 2 4 5
17 10 9 7
15 5 3 8
14 11 11 8
Example 2
INPUT: N=5
7 4 1 9 5
8 2 6 10 19
13 1 3 5 1
10 0 5 12 16
1 8 17 6 8
7 4 1 9 5
8 2 6 10 19
13 1 3 5 1
10 0 5 12 16
1 8 17 6 8
Page 4 of 19
Don Bosco School Liluah
REARRANGED MATRIX
1 1 1 4 5
19 0 1 2 6
17 3 5 5 7
16 6 10 12 8
13 10 9 8 8
2 6 10
1 3 5
0 5 12
Example 3
INPUT: M = 2
OUTPUT: SIZE OUT OF RANGE
Question 6
Write a program to accept a sentence which may be terminated by either ‘. ‘ or ?’ or ‘!’ only. Any
other character may be ignored. The words may be separated by more than one blank space and are
in UPPER CASE.
Perform the following tasks:
(a) Accept a sentence and remove all the extra blank space between two words to a single blank
space.
(b) Accept any word from the user along with its position and insert the word in the given position.
(The position is calculated by place value of each word where first word is in position 1, second
word in position 2 and so on).
c) Display the modified sentence.
Test your program for the following data and some random data.:
Example 1
INPUT: MORNING WALK IS A BLESSING FOR THE WHOLE DAY.
WORD TO BE INSERTED: TOTAL
WORD POSITION IN THE SENTENCE: 5
OUTPUT: MORNING WALK IS A TOTAL BLESSING FOR THE WHOLE DAY.
Example 2
INPUT: AS YOU SOW, SO YOU REAP!
WORD TO BE INSERTED : SHALL
Page 5 of 19
Don Bosco School Liluah
Example 3
INPUT: BETER LATE THAN NEVER#
OUTPUT: INVALID SENTENCE
Question 7
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.
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.
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 for the following data and some random data.
Example 1
INPUT: m = 40
n = 100
OUTPUT: THE COMPOSITE MAGIC INTEGERS ARE:
46, 55, 64, 82, 91, 100
Example 2
INPUT: m = 1210
n = 1300
OUTPUT: THE COMPOSITE MAGIC INTEGERS ARE:
1216, 1225, 1234, 1243, 1252, 1261, 1270, 1288
FREQUENCY OF COMPOSITE MAGIC INTEGERS IS: 8
Example 3
INPUT: m = 120
n = 97
OUTPUT: INVALID INPUT
Question 8
Write a program to declare a matrix A [ ] [ ] of order (M x 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 than 10. Allow
the user to input integers into this matrix. Display appropriate error message for an invalid input.
Perform the following tasks on the matrix.
(a) Display the input matrix
(b) Create and display the mirror image matrix
(c) Calculate the sum of the four corner elements of the matrix and display
Test your program for the following data and some random data:
Example 1
Page 6 of 19
Don Bosco School Liluah
INPUT: M = 3
N=4
8793
-2 0 4 5
1 3 6 -4
OUTPUT: ORIGINALMATRIX
8793
-2 0 4 5
1 3 6 -4
MIRROR MATRIX
3978
5 4 0 -2
-4 6 3 1
SUM OF THE CORNER ELEMENTS = 8
Example 2
INPUT: M = 2
N = 10
OUTPUT: INVALID INPUT
Question 9
Write a program to accept a paragraph containing two sentences 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 are in UPPER CASE.
Perform the following tasks:
(a) Accept the paragraph and check for validity
(b) Obtain the length/size of the two sentences separately (number of words)
(c) Find the common words which occur in both the sentences
Test your program with the sample data and some random data:
Example 1
INPUT: IS IT CLOUDY? IT MAY RAIN BECAUSE IT IS CLOUDY.
OUTPUT: SENTENCE 1: 3 WORDS
SENTENCE 2: 7 WORDS
COMMON WORDS: IS IT CLOUDY
Example 2
INPUT: TO BE OR NOT TO BE. TO LET GO AND BE HAPPY.
OUTPUT: SENTENCE 1: 6 WORDS
SENTENCE 2: 6 WORDS
COMMON WORDS: TO BE
Example 3
INPUT: IF YOU DRIVE FAST, YOU MAY MEET WITH AN ACCIDENT.
OUTPUT: INVALID PARAGRAPH
Example 4
INPUT: HOW ARE YOU@
OUTPUT: INVALID INPUT
Question 10
Page 7 of 19
Don Bosco School Liluah
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
Question 11
Input a paragraph containing ‘n’ number of sentences where (1 = < n < 4). The words are to be
separated with a single blank space and are in UPPERCASE. A sentence may be terminated either
with a full stop ‘.’ Or a question mark ‘?’ only. Any other character may be ignored. Perform the
following operations:
(i) Accept the number of sentences. If the number of sentences exceeds the limit, an appropriate error
message must be displayed.
(ii) Find the number of words in the whole paragraph
(iii) Display the words in ascending order of their frequency. Words with same frequency may
appear in any order.
Example 1
INPUT: Enter number of sentences : 1
Enter sentences : TO BE OR NOT TO BE.
OUTPUT:
Total number of words: 6
Page 8 of 19
Don Bosco School Liluah
WORD FREQUENCY
OR 1
NOT 1
TO 2
BE 2
Example 2
INPUT: Enter number of sentences : 3
Enter sentences : THIS IS A STRING PROGRAM.IS THIS EASY?YES,IT IS.
OUTPUT:
Total number of words: 11
WORD FREQUENCY
A 1
STRING 1
PROGRAM 1
EASY 1
YES 1
IT 1
THIS 2
IS 3
Example 3
OUTPUT:
INVALID ENTRY
Question 12
Design a program to accept a day number (between 1 and 366), year (in 4 digits) from the user
to generate and display the corresponding date. Also accept 'N' (1<=N<=100) from the user to
compute and display the future date corresponding to 'N' days after the generated date.
Display error message if the value of the day number, year and N are not within the limit or
Page 9 of 19
Don Bosco School Liluah
not according to the condition specified. Test your program for the following data and some
random data.
Example 1:
INPUT : DAY NUMBER : 233
YEAR : 2008
DATE AFTER(N) : 17
OUTPUT: 20TH AUGUST 2008
Example 2:
YEAR : 2008
DATE AFTER(N) : 45
Question 13
Write a program to accept a sentence as input. The words in the string are to be separated by a blank.
Each word must be in upper case. The sentence is terminated by either “.”,”!” or “?”. Perform the
following tasks:
Test your program with the sample data and some random data:
Example 1:
OUTPUT:
Length: 6
Rearranged Sentence:
Page 10 of 19
Don Bosco School Liluah
Example 2:
OUTPUT:
Length: 4
Question 14
Develop a program that accepts as input two strings, the first of which is ciphertext (i.e., an encoded
message) and the second of which is a key that can be used to decode it, and that produces as output
the plaintext (i.e., the original message).
The key is a string of four uppercase letters. To decode the first letter of ciphertext, "add" it (see
explanation below) to the first letter of the key. Similarly, to decode the second, third, and fourth
letters of ciphertext, "add" them to the second, third, and fourth, respectively, letters of the key.
Beginning with the fifth letter of ciphertext, use the four letters of the key once more, in the same
way. (Thus, the first letter of the key is used for decoding the 1st, 5th, 9th, etc., letters of ciphertext,
the second letter of the key is used for decoding the 2nd, 6th, 10th, etc., letters of ciphertext, and
similarly for the third and fourth letters of the key.)
To "add" two letters together, add their numeric values together (using A=1, B=2, C=3, ..., Z=26),
subtract 26 if the result is greater than 26, and then find the letter having the corresponding numeric
value. For example, E + C = H (corresponding to 5 + 3 = 8) and E + X = C (corresponding to
5 + 24 - 26 = 3).
Ciphertext given as input will not include lower case letters. It may, however, include spaces and
punctuation marks (e.g., periods, commas, etc.). Upper case letters are to be decoded as described
above. Any other characters are assumed to be their own codes. (E.g., The result of decoding a
comma is a comma.)
The program should accept input and provide output in the format shown below, repeating until a
null string is entered for a message.
Sample Program Execution:
Enter Ciphertext: EN UC ENDVCQG!
Enter Key: BALL
Plaintext: GO GO GOPHERS!
Question 15
A Keith number is an n-digit integer N>9 such that if a Fibonacci-like sequence (in which each term
in the sequence is the sum of the n previous terms) is formed with the first n terms taken as the
decimal digits of the number N, then N itself occurs as a term in the sequence. For example, 197 is a
Keith number since it generates the sequence 1, 9, 7, , , ,
, .
Design a class named “Keith” having the following data members and member functions :
Data Members:
Page 11 of 19
Don Bosco School Liluah
Question 16
A Circular Prime is a prime number that remains prime under cyclic shifts of its digits. When the
leftmost digit is removed and replaced at the end of the remaining string of digits, the generated number
is still prime. The process is repeated until the original number is reached again.
A number is said to be prime if it has only two factors I and itself.
Example:
131
311
113
Hence, 131 is a circular prime.
Test your program with the sample data and some random data:
Example 1
INPUT : N = 197
OUTPUT:
197
971
719
197 IS A CIRCULAR PRIME
Example 2
INPUT : N = 1193
OUTPUT:
1193
1931
9311
3119
1193 IS A CIRCULAR PRIME
Example 3
INPUT : N = 29
OUTPUT:
29
92
29 IS NOT A CIRCULAR PRIME
Question 17
The result of a quiz competition is to be prepared as follows:
Page 12 of 19
Don Bosco School Liluah
The quiz has five questions with four multiple choices (A, B, C, D), with each question carrying 1
mark for the correct answer. Design a program to accept the number of participants N such that N must
be greater than 3 and less than 11. Create a double dimensional array of size (Nx5) to store the answers
of each participant row-wise.
Calculate the marks for each participant by matching the correct answer stored in a single dimensional
array of size 5. Display the scores for each participant and also the participant(s) having the highest
score.
Example: If the value of N = 4, then the array would be:
Note: Array entries are line fed (i.e. one entry per line)
Test your program with the sample data and some random data:
Example 1
INPUT : N = 5
Participant 1 D A B C C
Participant 2 A A D C B
Participant 3 B A C D B
Participant 4 D A D C B
Participant 5 B C A D D
Key: B C D A A
OUTPUT : Scores :
Participant 1 D A B C C
Participant 1 = 0
Participant 2 = 1
Participant 3 = 1
Participant 4 = 1
Participant 5 = 2
Highest score: Participant 5
Example 2
INPUT : N = 4
Participant 1 A C C B D
Participant 2 B C A A C
Participant 3 B C B A A
Participant 4 C C D D B
Key: A C D B B
OUTPUT : Scores :
Participant 1 = 3
Participant 2 = 1
Page 13 of 19
Don Bosco School Liluah
Participant 3 = 1
Participant 4 = 3
Highest score: Participant 1, Participant 4
Example 3
INPUT : N = 12
OUTPUT : INPUT SIZE OUT OF RANGE.
Question 18
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:
Enter the number of participating teams:
5
Enter name of Team1 : England
Enter name of Team2 : South Africa
Enter name of Team3 : India
Enter name of Team4 : Australia
Enter name of Team5 : Sri lanka
OUTPUT:
E S I A S
Page 14 of 19
Don Bosco School Liluah
n o n u r
g u d s i
l t i t
a h a r L
n a a
d A l n
f i k
r a a
i
c
a
Question 19
Develop a program that reads an arithmetic expression written in English, such as
NINE PLUS SEVEN
and that outputs the number that is the result of evaluating the expression.
More precisely, the input will be a one-digit number, written as a word in upper case letters, followed
by a space, followed by one of the words "PLUS", "MINUS", "TIMES", or "DIVIDED-BY",
followed by a space, followed by another one-digit number, written as a word in upper case letters.
Here, "DIVIDED-BY" means integer division. (Example: 8 divided by 3 is 2.) The spellings for
one-digit numbers are as follows: "ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX",
"SEVEN", "EIGHT", and "NINE". You may assume that no input expression will call for division
by zero. Your program should repeat until the user enters an expression that evaluates to zero.
Sample Program Execution:
Input: NINE PLUS FOUR
Result: 13
Question 20
Design a “AutoSort” class having the following data members and member functions:
Member functions:
Page 15 of 19
Don Bosco School Liluah
AutoSort(int size) : a non parameterized constructor to initialize n with the value of size and
allocate memory space for ‘arr’.
void insert( ) : insert the elements within the array in such a way that the elements are all
arranged in the ascending order.
AutoSort merge(AutoSort m) : merges the contents of both the arrays in such way that after merging
the merged array has the elements in ascending order. Do not use any sorting algorithm to sort the
merged array.
Question 21
Write a program in java to accept any positive integer N and display the following list of numbers, if
the input N=30:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29
1 3 7 9 13 15 19 21 25 27
1 3 7 13 15 19 25 27
1 3 7 13 19 25 27
1 3 7 13 19 27
Question 22
Encryption is the process of encoding information, in our case a message, to make it unreadable
without special knowledge. This knowledge consists of the method of encryption and something
called a key.
We shall use a very simple method of encrypting a message. The message we will encrypt will only
contain the 26 capital letters and spaces. There is no punctuation in the messages. The key is a
sequence of distinct letters.
The method of encryption is as follows:
Look at each letter of the message. If the letter is in the key, replace it with the letter following it in
the key. If it is the last letter in the key, replace it with the first letter in the key. If the letter is not in
the key, don t change it.
Page 16 of 19
Don Bosco School Liluah
Your task will be to encrypt a message. You will be supplied with the unencrypted message and the
key. The unencrypted message will contain capital letters and spaces, and will be at most 255
characters long. The key will be at most 13 characters long. Letters will not be repeated in the key.
Sample run
Given the message COMPUTER OLYMPIAD, and the key MOPED, we can do the following:
CPOEUTDR PLYOEIAM
Input
Key: MOPED
Output
CPOEUTDR PLYOEIAM
Test your program with
Key: HARMONY
Key: AWDXBFTYHNKSU
Question 23
A sentence is terminated by either “ . ” , “ ! ” or “ ? ” followed by a space. Input a piece of text
consisting of sentences. Assume that there will be a maximum of 10 sentences in a block.
(i) Obtain the length of the sentence (measured in words) and the frequency of vowels in each
sentence.
(ii) Generate the output as shown below using the given data
Sample data:
INPUT :
Page 17 of 19
Don Bosco School Liluah
LUCK.
OUTPUT :
Question 24
A saddle point is an element of the matrix such that it is the minimum element for the row to which
is belongs and the maximum element for the column to which it belongs. Saddle point for a given
matrix is always unique. If the matrix has no saddle point, output the message “NO SADDLE
POINT”.
Class Name : Saddle
Data Member :
void dispPrimes( ) - displays the integers within the matrix which are prime.
void sumAboveLeft( ) - displays the sum of all the elements of the matrix above the left
diagonal.
void sortRowWise( ) - sorts the array row-wise, i.e., the smalles element should in the
location with indexes (0,0) and the laregest should be in the location (size-1,size -1).
State all the necessary validation checks for the above program.
Specify the class Saddle giving details of the constructor and member functions void
displayArray(), void saddlePoint( ) with main( ) function to create an object and call the functions
accordingly.
Question 25
A magic square is an n by n grid containing the integers 1 to n2, which fulfils this condition: each of
the sums of the n numbers on any row or column must add up to 0.5n(n2 + 1). Based on this
definition, an example magic square for n = 4 is
16 15 1 2
Page 18 of 19
Don Bosco School Liluah
6 4 10 14
9 8 12 5
3 7 11 13
Design a class named “MagicSquare” having the following data members and member functions
Data Members/ Instance Variables:
Member functions: :
void accept( ) accepts the size of the matrix from the user
void generate() Fills the matrix with some numbers generated randomly(less than n2).
Page 19 of 19