Professional Documents
Culture Documents
Class Xi - Computer Project
Class Xi - Computer Project
PROJECT
WORK
Programme – 6
Output:
Enter a number
175
It is a disarium number
Enter a number
346
It is not a disarium number
Variable description
Variable Description
num
Used in the sumofDigits and isDisarium methods. In sumofDigits, it represents the
number being processed. In isDisarium, it stores the original number being checked.
size
Used in the sumofDigits and isDisarium methods. In both methods, it represents the
number of digits in num.
value Used in the isDisarium method to store the result of the sumofDigits method.
n Used in the main method to store the number input by the user.
Programme – 7
Output:
Give an odd number: 3
610
345
978
Variable description
Variable Description
n
Used to store the odd number input by the user. This number also determines the
size of the magic square.
num
Used to store the current number being placed in the magic square. It starts at 1
and goes up to n * n.
r Represents the current row index in the magic square where num is being placed.
c
Represents the current column index in the magic square where num is being
placed.
Programme – 8
Output:
Enter the number of rows:3
Sorted matrix:
123
456
789
Variable description
Variable Description
rows Used to store the number of rows in the matrix, as input by the user.
cols Used to store the number of columns in the matrix, as input by the user.
matrix A 2D array that represents the matrix. Its size is rows x cols.
temp A 1D array used to store all elements of the matrix for sorting. Its size is rows * cols.
i and j Used as indices in the loops to traverse the matrix and the temp array.
swap Used to swap elements in the temp array during the sorting process.
Programme – 9
Output:
THE UNCOMMON CHARACTERS ARE: pplsd
Programme – 10
Output:
Enter a number: 202
It is a Smith Number
Enter a number: 27
It is a Smith Number
Variable description
Variable Description
n The number input by the user and checked if it’s a Smith number.
c A counter variable used in the Sopf method to iterate through potential factors of n.
ob An object of the Smith_Number class, used to call the methods in the class.
123
894
765
Variable description
Variable Description
rowStart, colStart The starting indices for the current spiral layer.
rowEnd, colEnd The ending indices for the current spiral layer.
Variable description
Variable Description
totalSumOfGaps
The total sum of the gaps between the ASCII values of consecutive characters
in the entire sentence.
sumOfGaps
The sum of the gaps between the ASCII values of consecutive characters in
each word.
gap The difference between the ASCII values of two consecutive characters.