Computer Project: Class X (2025-2026)
1) Write a program to accept a number and check whether the number is a palindrome or not.
Input : Enter a number : 12321
Output : 12321 is a palindrome number.
2) Write a program to print perfect numbers within a range. The range must be given by the user
at runtime.
Input : Enter a range : 5 500
Output : perfect number within the specified range are : 6, 28, 496
3) Write a program to input a number and check whether it is a Harshad number or not. The
program displays the message accordingly.
[ A number is said to be Harshad number, if it is divisible by the sum of its digits. For example:
132, Sum of its digits = 6 and 132 is divisible by 6. So, 132 is a Harshad number ]
Input : Enter a number : 353
Output : 353 is a not a Harshad number.
4) Write a program to print the pronic numbers within a range. The range must be given by the
user at runtime.
[ Pronic number is a number which is the product of two consecutive integers, that is, a number
n is a product of x and (x+1), Example: 56 = 7 * 8 i.e 56 is a product of two consecutive integers 7
and 8.]
Input: Enter the lower limit : 20
Enter the higher limit : 120
Output : Pronic numbers between 20 to 120 are : 20, 30, 42, 56, 72, 90, 110
5) Write a program using switch-case to display the following pattern:
a) 9 7 5 3 1 b) I
7 5 3 1 I N
5 3 1 I N D
3 1 I N D I
1 I N D I A
6) Write a program with the class name “Salary” and do the following:
i) Create the data member Basic, Gross with private access specifier and DA and HRA with
public access specifier.
ii) Create a input() method to input the basic pay from user.
iii) Create a calculate() method to find the DA, HRA and Gross using following formula
DA = 20% of Basic
HRA = 5% of Basic
Gross = Basic + DA + HRA
iv) Create a display() method to print all the data members.
Use main() method to create an object and call member methods of the class.
7) Write a program to define a class overload with the three-member function name “perimeter”-
i)void perimeter(double r) – to calculate perimeter of a circle.
ii) void perimeter(int a, int b, int c) – to calculate perimeter of a triangle.
iii) void perimeter(int side) – to calculate perimeter of a square.
8) Design a class to overload the method print() as follows
i) void print(double n) – display the sum of the following series
1.0 + 2.5 + 4.0 + 5.5 + … … … + n
ii) void print(int n) – display the sum of digits of n
iii) void print() – display the following pattern using nested loop
1
2 3
4 5 6
7 8 9 1
9) Write a program to define a class with the following specifications
Class name : Bill
Member variables : name – to store the name of the customer
bill_no – to store the bill_no
cost – cost of the article
amount – amount of bill generated
Member methods : void readdata() – accept the values of all member variables using
Scanner Class
void calculate() – calculates the discount as per the following criteria
and updates the amount accordingly
Amount (in Rs) % of discount
0 – 1000 2
1001 – 5000 5
5001 – 10000 10
Above 10000 15
However a GST of 5% is to be added to the final amount
void display() – display the name, bill_no and amount as shown
Name Bill_no Amount
XXXX XXXX XXXXX
10) Write a program to declare an array of size 20. Accept a search element from the user to
perform a binary search operation and display whether the search element is present within the
array or not. Also print the message “Binary Search Not Possible” if the array is not in ascending
order.
11) Write a program in java to input 15 integers and save them in a single dimensional array.
Perform the following tasks:
i) Print the elements in the array on a single line followed by a space.
ii) Compute and print the sum of elements at even indices.
iii) Compute and print the product of elements at odd indices.
12) Write a program to store 8 elements in an array A[] and 9 elements in an array B[].
Concatenate both arrays to create the third array C[], which contains all the array A[] and B[]
elements. Also, display the resultant array.
Example, Input : A[]={4, 6, 1, 2, 3, 8, 9, 0} B[]={5, 11, 10, 12, 13, 15, 18, 14, 20}
Output : C[]={4, 6, 1, 2, 3, 8, 9, 0, 5, 11, 10, 12, 13, 15, 18, 14, 20}
13) Write a program to accept a sentence from the user and count number of spaces, Alphabets,
Digits, Special characters.
14) Write a program to input a sentence and find the biggest word present in the sentence. Also,
print the length of the biggest word.
15) Write a program to accept a word and convert it into lowercase, if it is in uppercase. Display
the new word by replacing only the vowels with the letters following it.
Sample Input: Computer Sample Output: cpmpvtfr
16) Write a program that reads a string and a word separately. The program then find the
frequency of the word in the string.
Input : Enter a String : The quick brown fox jumps over the lazy dog.
Enter the word to search for : the
Output : Frequency of the is : 2
17) Define a class to accept 15 characters from a user. Using the bubble sort technique, arrange
them in descending order. Display the sorted array and the original array.
18) Define a class pin code and store the given pin codes in a single dimensional array. Sort these
pin codes in ascending order using the selection sort technique only. Display both the arrays.
Pin={ 110061, 110001, 110029, 110023, 110035, 110006, 110019, 110033}
19) Define a class to accept values into an array of order 4x4 and check whether it is a
DIAGONAL array or not. An array is DIAGONAL if the sum of the left diagonal elements equals the
sum of the right diagonal elements. Print the appropriate message.
Example,
3 4 2 5 Sum of the left diagonal elements =
2 5 2 3 3 + 5 + 2 + 1 = 11
5 3 2 7 Sum of the right diagonal elements =
1 3 7 1 5 + 2 + 3 + 1 = 11
20) Define a class to accept a number from user and check if it is an EvenPal number or not. The
program displays the message accordingly.
[ The number is said to be EvenPal number when number is palindrome number and sum of its
digits is an even number.]
Example : 121 – is a palindrome number
Sum of its digits – 1 + 2 + 1 = 4 which is an even number