You are on page 1of 6

CLASS 10 COMPUTER APPLICATION PROJECT PROGRAM - 2022

Dated of Submission: 29th November 2022


 Print in A4 sized paper
 Font Size: 13, Font Style: Arial, Font Color: Black. (The Cover Page may be in
Color)
 Line Spacing: 1.15
 Put Page numbers
 Place in Stick File.

PROJECT TEMPLATE

1) COVER PAGE COMPUTER PROJECT


Name:
Roll No:

2) Page 2 Onwards a) Problem Statements (Questions)


(Each question must be on a new page)
b) Program Code (using minimum 5 comments)
c) Variable Description:
Program 1
 A “Happy Word’ is defined as:
Take a word and calculate the word’s value based on position of the letters in English
alphabet. On the basis of word’s value, find the sum of the squares of its digits. Repeat the
process with the resultant number until the number equals 1 (one). If the number ends
with 1 then it is called a ‘Happy Word’. Write a program to input a word and check whether
it a ‘Happy Word’ or not. The program displays a message accordingly.
Sample Input: VAT (Place value of V=22, A=1, T=20)
Solution: 22120 = 2^2+2^2+1^2+2^2+0^2 = 13 = 1^2 + 3^2 = 10 = 1^2+0^2 = 1
Sample Output : A Happy Word

Program 2
Write a program to store names and marks of 20 students in two single dimensional arrays
and print the names of the students whose score is more than the average of all the
students.

Program 3
Write a program to store the names and marks obtained by a student in three subjects, find
the average marks of each student and print the names of the students in descending order
of their average marks. The total number of students is taken as input.

Program 4
Write a program to input a set of N words of equal length and check whether they form a
word ladder. From the 1st word to the second and second to the third and so on only a
single letter is replaced.
Example: JOY, TOY, TOE, HOE form a word ladder.

Program 5
Given an integer N, the following tasks are performed:
 The leading digit from N is subtracted from N and the resulting value is stored back in N.
 This process is continued till N becomes 0.
For example, take N = 13. The steps involved in the process of reducing 13 to 0 will be:
 13 – 1 = 12
 12 – 1 = 11
 11 – 1 = 10
 10 – 1 = 9
 9–9=0
Design a program to count the number of steps involved in the process of reducing a
number N to 0 as described above.

Program 6
A Prime-Adam integer is a positive integer (without leading zeroes) which is a prime as
well as an Adam number.
Prime number: A number which has only two factors, i.e. 1 and the number itself.
Example: 2, 3, 5, 7, etc.
Adam number: The square of a number and the square of its reverse are reverse to each
other. Example: If n = 13 and reverse of ‘n’ is 31, then, 132 = 169, and 312 = 961 which is
reverse of 169. Thus, 13 is an Adam number.
Accept two positive integers m and n, (where m is less than n). Display all Prime-Adam
integers that are in the range between m and n (both inclusive) and output them along with
the frequency of the numbers.

Program 7
A positive whole number ‘n’ that has ‘d’ number of digits is squared and split into two
pieces, a right-hand piece that has ‘d’ digits and a left-hand piece that has remaining ‘d’ or
‘d-1’ digits. If the sum of the two pieces is equal to the number, then ‘n’ is a Kaprekar
number. The first few Kaprekar numbers are: 9, 45, 297 ……..
Example 1: 9
92  = 81, right-hand piece of 81 = 1 and left hand piece of 81 = 8
Sum = 1 + 8 = 9, i.e. equal to the number.
Example 2: 45
452 = 2025, right-hand piece of 2025 = 25 and left hand piece of 2025 = 20
Sum = 25 + 20 = 45, i.e. equal to the number.
Example 3: 297
2972 = 88209, right-hand piece of 88209 = 209 and left hand piece of 88209 = 88
Sum = 209 + 88 = 297, i.e. equal to the number.
Given the two positive integers p and q, where p < q, write a program to determine how
many Kaprekar numbers are there in the range between p and q (both inclusive) and
output them.
The input contains two positive integers p and q. Assume p < 5000 and q < 5000. You are to
output the number of Kaprekar numbers in the specified range along with their values in
the format specified below:

Program 8
A hotel is giving a seasonal discount on the total amount to be paid by the person staying.
The charges for different rooms are given below
Category Tariff
Semi Deluxe Room Rs. 2500/- per day
Deluxe Room Rs. 3500/- per day
Super Deluxe Room Rs. 5000/- per day
The discount will be given as per the following criteria:
No. of days stayed Discount
Up to 3 days 10%
More than 3 days and up to 5 days 15%
More than 5 days and up to 10 days 20%
More than 10 days 30%
Write a program to input name of the guest, category (“S” for Semi-Deluxe, “D” for Deluxe,
“SD” for Super-Deluxe) and number of days stayed in the hotel. Calculate the discount and
total amount to be paid. Print the bill along with the name.

Program 9
An integer is said to be a palindrome if it is equal to its reverse. For example, 79197 and
324423 are palindromes. In this task you will be given an integer N, 1 ≤ N ≤ 1000000. Write
a program in Java to find the smallest integer M ≥ N such that M is a prime number and M is
a palindrome.
For example, if N is 31 then the answer is 101

Program 10
A bottling company manufactures packing cartons (boxes) in four sizes, i,e, carton to
accommodate 6 bottles, 12 bottles, 24 bottles and 48 bottles. Design a program in Java to
accept the number of bottles to be packed (N) by the user (maximum up to 1000 bottles)
and display the breakup of the cartons used in descending order of capacity (i.e preference
should be given to the highest capacity available, and if bottles are less than 6, an extra
carton of capacity 6 should be used.)
Test your program with the following data
Example 1: Input N = 726
Output 48 x 15 = 720
6x1=6

Example 2: Input N=124


Output 48 x 2 = 96
24 x 1 = 24
4 x1= 6

Program 11
Given a positive integer n, write a program to find the minimum number which can divide n
to make it a perfect square.
Input: n = 50
Output: 2
By Dividing n by 2, we get 25 which is a perfect square.
Input: n = 6
Output: 6
By Dividing n by 6, we get 1 which is a perfect square.
Input: n = 36
Output: 1
By Dividing n by 1, we get 36 which is a perfect square.

Program 12
A circular prime number is one that remains a prime number after repeatedly relocating
the first digit of the number to the end of the number. For example, 197, 971 and 719 are
all prime numbers. Similarly, 1193, 1931, 9311 and 3119 are all prime numbers. Other
numbers that satisfy the definition are 11, 13, 37, 79, 113, 199 and 337. Write a program to
input a number and check whether it is a Circular Prime number or not.

Program 13
Caesar Cipher is an encryption technique which is implemented as ROT13 (rotate by 13
places). It is a simple letter subscription cipher that replaces a letter with the letter 13
places after it in the alphabets, with the other characters remaining unchanged.
A/a B/a C/c D/d E/e F/f G/g H/h I/i J/j K/k L/l M/m
↕ ↕ ↕ ↕ ↕ ↕ ↕ ↕ ↕ ↕ ↕ ↕ ↕
N/n O/o P/p Q/q R/r S/s T/t U/u V/v W/w X/x Y/y Z/z
Write a program to accept a plain text and encrypt the text as per the Caesar Cipher.
Example 1: Input: Hello! How are you?
Output: The cipher text is: Uryyb? Ubj ner Lbh?

Program 14
Write a menu driven program to print the following patterns:-
Choice 1: 1 Choice 2: 12345
12 2345
123 345
1234 45
12345 5

Program 15
Write a program to print the following Floyds triangle of N lines.
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
...
...
N lines.

Program 16
Write a menu driven program to input a string and print the following patterns:-
Input String: MARVEL
Choice 1: M Choice 2: MARVEL
MA ARVEL
MAR RVEL
MARV VEL
MARVE EL
MARVEL L

Program 17
For a non-negative integer N, define a method sum(int N) as the sum of the odd digits of N
plus the sum of twice the even digits of N.
For example, sum(5) = 5, sum(456)=2*4+5+2*6 = 25, and sum(314159) = 3+1+2*4+1+5+9
=27.
Define digit(int N) as the last digit of sum(N). So D(5)=5, D(456)=5, and D(314159)=7.
Write a program to input 2 non-negative integers x and y, compute the sum of digit(N) over
all N between x and y, both inclusive.

Program 18
Odious number: where the number has an odd number of 1s in its binary expansion. The
first few odious numbers are therefore 1, 2, 4, 7, 8, 11, 13, 14, 16, 19..... Write a program to
input a number and check whether it is an Odious Number or not.

Program 19
Define a class Triangle in Java described as below:
Data Members/instance variables: side1, side2, side3, perimeter and area of double type
Member methods:
Triangle(….) A parameterized constructor to initialize the three sides of triangle.
void perimeter() to find the perimeter.
int type() to check the type of triangle formed and return 1 if the triangle
formed is Equilateral, 2 if Isosceles and 3 if Scalene.
void area() which calls the function type() and appropriately finds the area of the
triangle using respective formulas.
Equilateral triangle:

Isosceles triangle:
Scalene triangle = √(s(s-a)(s-b)(s-c)) and s = ½ (a + b + c) is the semi-
perimeter of the triangle.
void print() to display the area and perimeter of the triangle.
Write a main method to create object of a class and call the member methods.

Program 20
Define a class Tour in Java with the description given below:
Data Members: tcode of type string, noadult of type integer, nokids of type integer,
km of type integer, totfare of type float,
Members Methods:
Tour() Constructor to assign 0 or null to the data members.
void enterTour( ) to input the values of the data members.
void assignFare( ) which calculates and assigns the totfare as:
For each Adult Fare(Rs) For Kilometres
500 >=1000
300 <1000 &>=500
200 <500
For each Kid the above Fare will be 50% of the Fare:
For example:
If km = 850, noadult = 2 and nokids = 3
totfare = noadult * 300 + nokids * 150, i.e. 2*300 + 3*150=1050
void showTour( ) which displays the all the data members.
Write a main method to create object of a class and call the member methods.

………………………….xxx………………………..

You might also like