Professional Documents
Culture Documents
Session: 2023-2024
Subject: Computer Applications
Instructions:
Each program should be written in such a way that it clearly depicts the logic of the
problem.
Use mnemonic names and comments in the program.
1. Write a program to input a number and check whether it is a Lead number or not.
A number is said to be a Lead number is the sum of the even digits in the number is
equal to the sum of the odd digits in the number.
e.g.
Input :
6374
Output:
6374 is a Lead number
(a) void series (int x, int n) – To display the sum of the series given below:
x1 + x2 + x3 + .......... xn terms
(c) void series () – To display the sum of the series given below:
3. Using the switch statement, write a menu driven program to calculate the maturity
amount of a Bank Deposit.
The user given the following options:
i) Term Deposit.
ii) Recurring Deposit.
For the option i) accept principal (p) rate of interest (r ) and time period in years.
Calculate and output the maturity amount (A) receivable by using the following formula:
( )
n
r
A=P 1+
100
For the option (II) accept the monthly instalment (P), rate of interest (r) and time period
in months (n) Calculate and output the maturity amount (A) receivable by using the
following formula
n ( n+1 ) r 1
A=P× n+ P × × ×
2 100 12
4. Write a program to accept a number and check and display whether it is a Strontio
number or not.
A number is said to be a Strontio number, if we multiply 2 with a four-digit number
then in the resultant number the tens place and hundreds place digits are the same.
The input number is 1111.
Multiply 2 with the given number= 1111 * 2 = 2222.
Hence, 1111 is a Strontio number.
5. Write a menu driven program to perform the following function (Use switch case
statement
i) To print the series 2,6,12,20……..n terms (the value of n is entered by the user.)
ii) To find the sum of the series given bellow
S=1/2 + 3/4 + 4/5+ 6/7…….19/20.
6. Write a program in Java to accept a number and check whether it belongs to the
Fibonacci Series (sequence) or not.
Fibonacci Series:
The Fibonacci Sequence is the series of numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, …
The first two numbers in the series is ‘0’ and ‘1’ and every next number is found
by adding up the two numbers before it.
7. Write a Program in Java to input a number and check whether it is an Evil Number or
not.
Evil Number: An Evil number is a positive whole number which has even number of 1’s
in its binary equivalent.
Example: Binary equivalent of 9 is 1001, which contains even number of 1’s.
A few evil numbers are 3, 5, 6, 9….etc.
8. A cloth showroom has announced the following festival discounts on the purchase of
items, based on the total cost of the items purchased:
10. Write a java program to find the Armstrong number from 1 to 1000.
(Armstrong number is that number who’s each digit’s cube is added to together and the
result is equal to the given number, then such kind of number is called Armstrong
number for e.g. 153= 13+23+33.
12. Special words are those words which start And end with same letters.
Example: EXISTENCE, COMIC, WINDOW etc.
Palindrome words are those words which read the same letters from left to right and
vice-versa.
Example: MALAYALAM, MADAM, LEVEL, ROTATOR etc.
All palindrome words are special words, but all special words are not palindromes.
Write a program to accept a word check and print whether the word is a palindrome or
only special word.
15. Write a program to store the age of 10 students in an integer array and arrange
them in ascending order using Bubble sort technique.
16. Write a program to accept a string. Convert the string into the upper case .Count and
output the number of double letters sequences word that exists in the string.
Sample Input: AARTI BOUGHT A COTTON SHIRT AND BUTTER FROM MALL
Sample Output: Numbers of double letter word=4
17. A Smith number is a composite number, the sum of whose digits is the sum of the
digits of its prime factors obtained as a result of prime factorization (excluding 1). The
first few such numbers are 4, 22, 27, 58, 85, 94, 121 ………………..
Example:
666
Prime factors are 2, 3, 3, and 37
Sum of the digits are (6+6+6) = 18
Sum of the digits of the factors (2+3+3+ (3+7)) = 18
Write a program to input a number and display whether the number is a Smith
number or not.
18. The encryptions of alphabets are to be done as follows:
A=1
B=2
C=3
.
.
Z = 26
The potential of a word is found by adding the encrypted value of the alphabets.
Write a program to input a word and find its potential.
Example: KITE
Potential = 11 + 9 + 20 + 5 = 45
19. Write a program to input a string and print the text with the uppercase and
lowercase letters reversed, but all other characters should remain the same as
before.
Example:
INPUT: WelCome TO School
OUTPUT: wELcOME to sCHOOL