0% found this document useful (0 votes)
29 views29 pages

ICT Record (2024 - 25)

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)
29 views29 pages

ICT Record (2024 - 25)

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/ 29

ICT R ECORD

P ROGRAMS L IST
P RG PG.
P ROGRAM T ITLE / I NDEX P AG E L IST D ATE
NO. NO.
1 CONCATENATION OF SUM AND PRODUCT OF TEN NUMBERS
2 CHARACTER OF REVERSED ASCII
3 SUM OF EVEN AND ODD NUMBERS
4 LINEAR SEARCH
5 BINARY SEARCH
6 SELECTION SORT
7 BUBBLE SORT
8 SUM OF THE MATRIX
9 SUM OF ROWS AND COLUMNS OF MATRIX
10 SUM OF DIAGONAL ELEMENTS OF MATRIX
11 STRING HANDLING
12 REPLACE CONSONANTS
13 PALINDROME FROM ARRAYS
14 POLYMORPHISM
15 FUNCTION OVERLOADING
16 USER DEFINED METHODS
17 VOWELS
18 CHARACTER ORIENTED FUNCTIONS
19 CONSTRUCTORS
20 PARAMETERISED CONSTRUCTORS
1. Write a program to input a set of any 10 integer numbers. Find the sum and product
of the numbers. Join the sum and product to form a single number. Display the
concatenated number.
[Hint: let sum = 245 and product = 1346 then the number after joining sum and product will
be 2451346]
VARIABLE DESCRIPTION :

VARIABLE DATA TYPE DESCRIPTION


i int Used as for loop index
no int To get a number as input
sum long To store the sum of ten numbers
prod long To store the product of ten numbers
st String To store the concated values as string
res long To store the result as a numeric value converted from a string

PROGRAM CODING :
2. Write a program to input a letter. Find its ASCII code. Reverse the ASCII code and
display the equivalent character.
Sample Input: Y
Sample Output: ASCII Code = 89
Reverse the code = 98
Equivalent character: b
VARIABLE DESCRIPTION :

VARIABLE DATA TYPE DESCRIPTION


ch char To get a character as input
ascCh int To store the ASCII value of the character
digit int To store the digit extracted from the ASCII value
ascRev int To store the reversed value of the ASCII

PROGRAM CODING :
3. Write a program to store 20 numbers (even and odd numbers) in a Single Dimensional
Array (SDA). Calculate and display the count and the sum of all even numbers and all
odd numbers separately.
VARIABLE DESCRIPTION :

VARIABLE DATA TYPE DESCRIPTION


i int Used as for loop index value
arrLen int To store the length of the array (number of elements in an array)
oddSum int To store the sum of all odd numbers
evenSum int To store the sum of all odd numbers
evenCnt int To store the count of all odd numbers
oddCnt int To store the count of all odd numbers
arr[ ] int Single Dimensional Array to store numbers
4. Write a program to accept 10 different numbers in a Single Dimensional Array (SDA).
Enter a number and search whether the number is present or not in the list of array
elements by using the Linear Search technique.
VARIABLE DESCRIPTION :

VARIABLE DATA TYPE DESCRIPTION


i int Used as for loop index value
noSrc int To get a number to be searched as input
isFound int To indicate whether the number is found in the array or not
arr[ ] int Single Dimensional Array to store numbers
5. Write a program to accept 10 different numbers in a Single Dimensional Array (SDA).
Enter a number and search whether the number is present or not in the list of array
elements by using the Binary Search technique.
VARIABLE DESCRIPTION :
VARIABLE DATA TYPE DESCRIPTION
i int Used as for loop index value
noSrc int To get a number to be searched as input
isFound int To indicate whether the number is found in the array or not
lb int To store the lower boundary element index value of the array
ub int To store the upper boundary element index value of the array
mid int To store the middle element index value of the array
arr[ ] int Single Dimensional Array to store numbers
6. Write a program to accept 10 different numbers in a Single Dimensional Array (SDA).
Arrange the numbers in ascending order by using the Selection Sort technique and
display the sorted array.
VARIABLE DESCRIPTION :
VARIABLE DATA TYPE DESCRIPTION
i int Used as outer for loop index value
j int Used as inner for loop index value
temp int To store value temporarily during swapping for numbers
min int To store the index of the minimum value
arr[ ] int Single Dimensional Array to store numbers
7. Write a program to accept 10 different numbers in a Single Dimensional Array (SDA).
Arrange the numbers in ascending order by using the Bubble Sort technique and
display the sorted array.
VARIABLE DESCRIPTION :
VARIABLE DATA TYPE DESCRIPTION
i int Used as outer for loop index value
j int Used as inner for loop index value
temp int To store value temporarily during swapping for numbers
arr[ ] int Single Dimensional Array to store numbers
8. Write a program to store the numbers in a 3 * 4 matrix in a Double Dimensional Array
(DDA). Find the sum of all the numbers of the matrix and display the sum.
Sample Output:
The numbers of the matrix are :
12 21 13 14
24 41 51 33
61 11 30 29
The sum of the elements of the matrix is 340
VARIABLE DESCRIPTION :
VARIABLE DATA TYPE DESCRIPTION
i int Used as outer for loop index value
j int Used as inner for loop index value
matrixSum int To store the sum of all the elements of the matrix
arr[ ][ ] int Double Dimensional Array to store numbers
9. Write a program to store the numbers in a 4 * 4 matrix in a Double Dimensional Array
(DDA). Find the sum of the numbers in each row and the sum of the numbers in each
column of the matrix and display the sum.
Sample Output:
The numbers of the matrix are :
12 21 13 14
24 41 51 33
61 11 30 29
59 82 41 76
The sum of the elements of each row :
The sum of the elements of 1st row = 60
The sum of the elements of 2nd row = 149
The sum of the elements of 3rd row = 131
The sum of the elements of 4th row = 258
The sum of the elements of each column :
The sum of the elements of 1st column = 156
The sum of the elements of 2nd column = 155
The sum of the elements of 3rd column = 135
The sum of the elements of 4th column = 152
VARIABLE DESCRIPTION :
VARIABLE DATA TYPE DESCRIPTION
i int Used as outer for loop index value
j int Used as inner for loop index value
rowSum int To store the sum of the elements of each row in the matrix
colSum int To store the sum of the elements of each column in the matrix
arr[ ][ ] int Double Dimensional Array to store numbers
10. Write a program to store the numbers in a 4 * 4 matrix in a Double Dimensional Array
(DDA). Find the sum of the numbers of left diagonal and the sum of the numbers of
right diagonal of the matrix and display the sum.
Sample Output:
The numbers of the matrix are :
12 21 13 14
24 41 51 33
61 11 30 29
59 82 41 76
The sum of the left diagonal elements = 159
The sum of the right diagonal elements = 135
VARIABLE DESCRIPTION :
VARIABLE DATA TYPE DESCRIPTION
i int Used as outer for loop index value
j int Used as inner for loop index value
leftDiagSum int To store the sum of the left diagonal elements in the matrix
rightDiagSum int To store the sum of the right diagonal elements in the matrix
rdIdx int To store the right diagonal index value
arr[ ][ ] int Double Dimensional Array to store numbers
11. Write a program to accept a String in upper case and replace all the vowels present
in the String with an Asterisk (*) sign.
Sample Input: TATA STEEL IS IN JAMSHEDPUR
Sample Output: T*T* ST**L *S *N J*MSH*DP*R
VARIABLE DESCRIPTION :

VARIABLE DATA TYPE DESCRIPTION


str String To get a string as input
newStr String To store the result string
ch char To extract a character from the string str
i int Used as for loop index value
len int To store the length of the string (number of characters)
12. Write a program to accept a sentence. Create a new sentence by replacing each
consonant with the previous letter. If the previous letter is a vowel, then replace it with
the next letter (i.e., if the letter is B then replace it with C as the previous letter of B is
A). Other characters must remain the same. Display the new sentence.
Sample Input: ICC WORLD CUP
Sample Output: IBB VOQKC BUQ
VARIABLE DESCRIPTION :
VARIABLE DATA TYPE DESCRIPTION
str String To get a string as input
newStr String To store the result string
ch char To extract a character from the string str
chUp char To convert and store the uppercase letter of ch
prevChar char To get the previous letter of ch
prevCharUp char To convert and store the uppercase letter of prevChar
i int Used as for loop index value
len int To store the length of the string (number of characters)
13. Write a program to store 10 words in a Single Dimensional Array. Display only those
words which are Palindrome.
Sample Input: MADAM, TEACHER, SCHOOL, ABBA, .........
Sample Output: MADAM
ABBA
..........
VARIABLE DESCRIPTION :

VARIABLE DATA TYPE DESCRIPTION


i int Used as outer for loop index value
j int Used as inner for loop index value
words[ ] String Single Dimensional Array to store strings
arrLen int To store the number of strings in the array
str String To get and store a string from the array
strLen int To store the length of the string str
ch char To extract a character from the string str
14. Design a class to overload a method compare( ) as follows:
void compare(int, int) - To compare two integers values and print the greater
of the two integers.
void compare(char, char) - To compare the numeric value of two characters and
print with the higher numeric value.
void compare(String, String) - To compare the length of the two strings and print the
longer of the two.
VARIABLE DESCRIPTION :

VARIABLE DATA TYPE DESCRIPTION


x,y int To store the ASCII value of the character parameters
l1 , l2 int To store the length of the string parameters
n1 , n2 int To store the numbers as input values
c1 , c2 char To store the characters as input values
s1 , s2 String To store the strings as input values
15. Design a class to overload the method display(.....) as follows:
void display(int num) - To check and print whether the number is a
perfect square or not.
void display(String str, char ch) - To check and print if the word str contains the
letter ch or not.
void display(String str) - To check and print the number of special
characters present in the word str.
VARIABLE DESCRIPTION :

VARIABLE DATA TYPE DESCRIPTION


x,y int To store the ASCII value of the character parameters
l1 , l2 int To store the length of the string parameters
n1 , n2 int To store the numbers as input values
c1 , c2 char To store the characters as input values
s1 , s2 String To store the strings as input values
16. Design a class to overload the method display(.....) as follows:
void display(String str, char ch) - To check whether the word str contains the
letter ch at the beginning as well as at the
end or not. If present, print 'Special Word'
otherwise print 'No special word'.
void display(String str1, String str2) - To check and print whether both the words
are equal or not.
void display(String str , int n) - To print the character present at nth
position in the word str.
17. Write a program by using a class with following specification:
Class name : Vowel
Data Members : String s, int c (To count vowels)
Member Methods :
void getstr( ) - To accept a string
void getvowel( ) - To count the number of vowels
void display( ) - To print the number of vowels
18. Write a program by using a class with following specification:
Class name : Characters
Data Members : str - String
Member Methods :
void input (String st) - To accept a string
void check_print() - To count the number of vowels
(i) Number of letters
(ii) Number of digits
(iii) Number of uppercase characters
(iv) Number of lowercase characters
(v) Number of special characters
19. Write a program by using a class with following specification:
Class name : Stringop
Data Members : str - String
Member Methods :
Stringop( ) - Constructor to initialize str with NULL
void accept ( ) - To input a sentence
void encode ( ) - To replace and print each character of the string with the
second next character in the ASCII table. For example, A
with C, B with D and so on
void print ( ) - To print the new string
20. Write a program by using a class with following specification:
Class name : Calculate
Data Members : num, f, rev - int
Member Methods :
Calculate(int n) - Parameterised constructor to initialize num with n, f and rev
with 0 (zero)
void prime ( ) - To return 1, if number is prime
void reverse ( ) - To return reverse of the number
void display ( ) - To check and print whether the number is a prime palindrome
or not
G ENERAL I NSTRUCTIONS :
1. ALL HEADINGS to be written in SMALL CAPS.
2. VARIABLE DESCRIPTION and OUTPUT to be written in pencil on the unruled side.
3. VARIABLE DESCRIPTION to be written on unruled side (left side) where the program starts.
4. OUTPUT DESCRIPTION to be written on unruled side (left side) where the RESULT is written.
5. Need not write the line numbers represented in the program. That is only for the reference.

You might also like