You are on page 1of 5

Project work for class X

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

2. Design a class to overload a function series( ) as follows:

(a) void series (int x, int n) – To display the sum of the series given below:

x1 + x2 + x3 + .......... xn terms

(b) void series (int p) – To display the following series:

0, 7, 26, 63 .......... p terms

(c) void series () – To display the sum of the series given below:

1/2 + 1/3 + 1/4 + .......... 1/10

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

For incorrect answer an appropriate error message must be displayed.

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:

Total cost Discount(in percentage)

Less than Rs.5000 5%

Rs.5001 to Rs.10000 25%

Rs.10001 to Rs. 20000 35%

Above Rs. 20001 50%


Write a program to accept the total cost and to compute and display the amount to be
paid by the customer after availing the discount.

9. A bank intends to design a program to display the denomination of an input amount,


up to 5 digits. The available denomination with the bank are of rupees 1000 , 500 ,
100 , 50 , 20 , 10 , 5 , 2 , and 1.
Design a program to accept the amount from the user and display the break-up in
descending order of denomination. (i.e. preference should be given to the highest
denomination available) along with the total number of notes. [Note: Only the
denomination used, should be displayed.
Example:
INPUT: 14788
OUTPUT:
DENOMINATIONS:
2000 x 7 = 14000
500 x 1 = 500
100 x 2 = 200
50 x 1 = 50
20 x 1 = 20
10 x 1 = 10
5 x 1 = 5
2 x 1 = 2
1 x 1 = 1
————————————–
TOTAL = 14788
————————————–
Total Number of Notes = 16

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.

11. Write a program to print the Pascal’s triangle.


1
11
121
1331
14641

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.

13. The standard form of a quadratic equation is given by:


ax2+bx+c=0, where a, b and c are the coefficients of x2, x and c is constant respectively
and d=b2-4ac, where d is known as discriminant
if d>0 then roots are real and distinct
if d=0 then roots are real and equal
if d<0 then roots are imaginary
The roots of the quadratic equation are determined by the formula: x=-b±√ b 2-4ac/2a
Write a program in Java to determine the roots and nature of roots of the quadratic equation
after taking a, b, and c as inputs.

14. Design a class to overload a function area( ) as follows:


(i) void area( double a, double b, double c) with three double argument and calculate
the area of scalene triangle using this formula-
area=√ s ( s−a )( s−b ) ( s−c )
where- s=(a+b+c)/2
(ii) void area(int a, int b, int h) with three integer arguments and calculates the area of
trapezium-
area=1/2*(a+b)*h
(iii) void area(double d1,double d2) with two double argument and calculate the area of
rhombus using this formula-
area=1/2*d1*d2

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

20. Design a class Vehicle with following description:


Instance variables/data members:
int bno : to stores the bike’s number
String name : to store the name of the customer
long phno : to store customer’s mobile number
int days : to store the number of days the bike is taken on
rent
double charge : to calculate and store the rental charge
Member functions/ member methods:
Vehicle( ) : Default constructor
void input : to input and store the details of the customer
void compute( ) : to compute the rental charge
The rent for a Yobike is charged on the following basis:

Number of days bike Amount


On rent (in Rupees)
First five days 500 per day
Next seven days 300 per day
Rest of the days 250 per day

void display() : to display the details in the following format:

Bike No. Name Phone No. No. of Days Charge


………….. ……….. ……………… ……………….. ………….
Write a main method to create an object of the class and call the above member
methods.

You might also like