Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

COMPUTER APPLICATIONS

PROJECT- CLASS X
SESSION 2022-23

Execute the following programs and submit the documentation of the program. Write the
question, program, algorithm, VDT, output and comments (atleast 5) for each program.
First 20 programs to be submitted by 30th June, 2021 and the last 15 programs by 30th
November, 2021. Use functions at the necessary places replacing nested loops.

1. Design a class to overload a function check ( ) as follows :


(i) void check (String str, char ch) – to find and print the frequency of a
character in a string.
Example :
Input:
str = “success”
ch = ‘s’ .
Output:
number of s present is = 3

(ii) void check(String s1) – to display only vowels from string s1, after converting
it to lower case.
Example:
Input:
s1 = “computer”
Output:
oue

2. Write a program to accept name and total marks of N number of students in two
single subscript array name[] and totalmarks[ ]. 
Calculate and print:
(i) The average of the total marks obtained by N Number of students.
[average = (sum of total marks of all the students)/N]
(ii) Deviation of each student’s total marks with the average.
[deviation = total marks of a student – average]
3. Write a program to input 15 integer elements in an array and sort them in
ascending order using the bubble sort technique.
4. Write a program to input integer elements into an array of size 20 and perform
the following operations:
(i) Display largest number from the array.
(ii) Display smallest number from the array.
(iii) Display sum of all the elements of the array.
5. Write a program to input 20 words in an array. Arrange these words in
descending order of alphabets, using selection sort technique. Print the sorted
array.
6. Write a program to initialize the seven Wonders of the World along with their
locations in two different arrays. Search for a name of the country input by the
user. If found, display the name of the country along with its Wonder, otherwise
display “Sorry Not Found!”.
Seven wonders — CHICHEN ITZA, CHRIST THE REDEEMER, TAJMAHAL,
GREAT WALL OF CHINA, MACHU PICCHU, PETRA, COLOSSEUM
Locations — MEXICO, BRAZIL, INDIA, CHINA, PERU, JORDAN, ITALY
Example — Country Name: INDIA   Output: INDIA-TAJMAHAL
Country Name: USA   Output: Sorry Not Found!
7. Write a program to input and store roll numbers, names and marks in 3 subjects
of n number students in five single dimensional array and display the remark
based on average marks as given below : (The maximum marks in the subject
are 100) 

8. Design a class to overload a function Joystring( ) as follows :


(i) void Joystring (String s, char ch1 char ch2) with one string argument and two
character arguments that replaces the character argument ch1 with the
character argument ch2 in the given string s and prints the new string.
Example:
Input value of s = “TECHNALAGY”
ch1=‘A’,
ch2=‘O’
Output: TECHNOLOGY
(ii) void Joystring (String s) with one string argument that prints the position of
the first space and the last space of the given string s.
Example:
Input value of = “Cloud computing means Internet based computing”
Output: First index : 5
Last index : 36
(iii) void Joystring (String s1, String s2) with two string arguments that combines
the two string with a space between them and prints the resultant string.
Example :
Input value of s1 =“COMMON WEALTH”
Input value of s2 =“GAMES”
Output: COMMON WEALTH GAMES
(use library functions) 
9. Write a program to input twenty names in an array. Arrange these names in
descending order of alphabets, using the bubble sort technique. 
10. A special two-digit number is such that when the sum of its digits is added to the
product of its digits, the result is equal to the original two-digit number.
Example: Consider the number 59.
Sum of digits = 5 + 9=14
Product of its digits = 5 x 9 = 45
Sum of the sum of digits and product of digits = 14 + 45 = 59
Write a program to accept a two-digit number. Add the sum of its digits to the
product of its digits. If the value is equal to the number input, output the
message “Special 2-digit number” otherwise, output the message “Not a special
2-digit number”. 
11. Design a class to overload a function area( ) as follows:
(i) double area (double a, double b, double c) with three double arguments,
returns the area of a scalene triangle using the formula:
area = √ s (s−a)( s−b)( s−c)  
where s=(a+b+c)/2
(ii) double area (int a, int b, int height) with three integer arguments, returns the
area of a trapezium using the formula:
area = 1/2 height (a + b)
(iii) double area (double diagonal 1, double diagonal 2) with two double
arguments, returns the area of a rhombus using the formula :
area = 1/2 (diagonal 1 x diagonal 2)  
12. Using the switch statement, write a menu driven program to calculate the
maturity amount of a Bank Deposit.
The user is given the following options :
(i) Term Deposit
(ii) Recurring Deposit
For option (i) accept principal (P), rate of interest(r) and time period m years(n).
Calculate and output the maturity amount (A) receivable using the formula

For option (ii) accept Monthly Instalment (P), rate of interest (r) and time period
in months (n). Calculate and output the maturity amount (A) receivable using
the formula

For an incorrect option, an appropriate error message should be displayed. 


13. Write a program to accept the year of graduation from school as an integer value
from, the user. Using the Binary Search technique on the sorted array of integers
given below.
Output the message “Record exists” If the value input is located in the array. If
not, output the message “Record does not exist”.
{1982, 1987, 1993, 1996. 1999, 2003, 2006, 2007, 2009, 2010}
14. Define a class named Fruit Juice with the following description: 
Instance variables / data members :
int product_code — stores the product code number
String flavour — stores the flavour of the juice (E.g. orange, apple, etc.)
String pack_type — stores the type of packaging (E.g. tetra-pack, PET bottle,
etc.)
int pack_size — stores package size (E.g. 200 ml, 400 ml, etc.)
int product_price — stores the price of the product
Member methods :
(i) FruitJuice() — Default constructor to initialize integer data members to 0 and
String data members to “ ”.
(ii) void input( ) — To input and store the product code, flavour, pack type, pack
size and product price.
(iii) void discount( ) — To reduce the product price by 10.
(iv) void display() — To display the product code, flavour, pack type, pack size
and product price.
15. The International Standard Book Number (ISBN) is a unique numeric book
identifier which is printed on every book. The ISBN is based upon a 10-digit
code. The ISBN is legal if:
1 × digit1 + 2 × digit2 + 3 × digit3 + 4 × digit4 + 5 × digit5 + 6 × digit6 + 7 × digit7 +
8 × digit8 + 9 × digit9 + 10 × digit10 is divisible by 11.
Example : For an ISBN 1401601499
Sum = 1×1 + 2×4 +3×0 + 4×1 + 5×6 + 6×0 + 7×1 + 8×4 + 9×9 + 10×9 = 253 which
is divisible by 11.
Write a program to :
(i) Input the ISBN code as a 10-digit integer.
(ii) If the ISBN is not a 10-digit integer, output the message, “Illegal ISBN” and
terminate the program.
(iii) If the number is 10-digit, extract the digits of the number and compute the
sum as explained above.
If the sum is divisible by 11, output the message, “Legal ISBN”. If the sum is not
divisible by 11, output the message, “Illegal ISBN”. 
16. A tech number has even number of digits. If the number is split in two equal
halves, then the square of sum of these halves is equal to the number itself. Write
a program to generate and print all four digits tech numbers.
Example
Consider the number : 3025
Square of sum of the halves of 3025=(30+25)2= (55)2
=3025 is a tech number.
17. Write a program to input 10 integer elements in an array and sort them in
descending order using the bubble sort technique. 
18. Design a class to overload a function series ( ) as follows :
(i) double series (double n) with one double argument and returns the sum of the
series,
(ii) double series (double a, double n) with two double arguments and returns the
sum of the series. 

19. Write a program to input 10 numbers into an integer array and interchange the
consecutive elements in it. That is, interchange a[0] with a[1], a[2] with a[3], a[4]
with a[5]…..
For example, if array contains

9 12 3 7 89 34 15 16 67 25
a[0] a[1] a[2] a[3] a[4] a[5] a[6] a[7] a[8] a[9] After
interchange it should have the elements arranged as:

12 9 7 3 34 89 16 15 25 67
a[0] a[1] a[2] a[3] a[4] a[5] a[6] a[7] a[8] a[9]

20. Design a class to overload a function polygon() as follows:-


(i) void polygon(int n, char ch) — with one integer argument and one character
type argument that draws a filled square of side n using the character stored in
ch.
(ii) void polygon(int x, int y) — with two integer arguments that draws a filled
rectangle of length x and breadth y, using the symbol ‘@’.
(iii) void polygon( ) — with no argument that draws a filled triangle shown
below.
Example :

21. Write a program to accept the names of 10 cities in a single dimensional string
array and their STD (Subscribers Trunk Dialling) codes in another single
dimensional integer array. Search for a name of a city input by the user in the
list. If found, display* “Search successful” and print the name of the city along
with its STD code, or else display the message “Search Unsuccessful, No such city
in the list”. 
22. Define a class called mobike with the following description:
Instance variables /data members:
String bno — to store the bike’s number for eg(UP65AB1234)
int phno — to store the phone number of the customer
String name — to store the name of the customer
int days — to store the number of days the bike is taken on rent
int charge — to calculate and store the rental charge
Member methods:
void input() — to input and store the detail of the customer.
void compute() — to compute the rental charge.
The rent for a mobike is charged on the following basis:
First five days Rs. 500 per day.
Next five days Rs. 400 per day.
Rest of the days Rs. 200 per day.
void display() — to display the details in the following format:  

23. Write a program to input and store the weight of ten people. Sort and display
them in descending order using the selection sort technique. 
24. Write a program to input a number and print whether the number is a special
number or not.
(A number is said to be a special number, if the sum of the factorial of the digits
of the number is same as the original number).
Example : 145 is a special number, because 1!+4!+5! = 1 + 24 + 120 = 145
(where ! stands for factorial of the number and the factorial value of a number is
the product of all integers from 1 to that number, example 5! = 1*2*3*4*5 =
120). 
25. Write a program to accept a word and convert it into lowercase if it is in
uppercase, and display the new word by replacing only the vowels with the
character following it :
Example :
Sample Input : computer
Sample Output : cpmpvtfr 
26. Design a class to overload a function compared as follows :
(a) void compare(int, int) — to compare two integer values and print the greater
of the two integers.
(b) void compare(char, char) — to compare the numeric value of two characters
and print the character with higher numeric value.
(c) void compare(String, String) — to compare the length of the two strings and
print the longer of the two. 
27. A double dimensional array is defined as N[4][4] to store numbers. Write a
program to find the sum of all even numbers and product of all odd numbers
of the elements stored in Double Dimensional Array (DDA).
Sample Input:
12 10 15 17

30 11 32 71

17 14 29 31

41 33 40 51

Sample Output:
Sum of all even numbers: ..........
Product of all odd numbers: ..........

28. A Departmental Shop has 5 stores and 6 departments. The monthly sale of the
department is kept in the Double Dimensional Array (DDA) as m[5][6]. The
manager of the shop may want to know the total monthly sale of each store and
each department at any time. Write a program to perform the given task.
(Hint: Number of stores as rows and Number of departments as columns.

29. A Metropolitan Hotel has 5 floors and 10 rooms in each floor. The names of the
visitors are entered in a Double Dimensional Array (DDA) as M[5][10].The
Hotel Manager wants to know from the "Enquiry" about the position of a
visitor (i.e. floor number and room number) as soon as he enters the name of the

visitor. Write a program in Java to perform the above task.

30. A Class Teacher wants to keep the records of 40 students of her class along with
their names and marks obtained in English, Hindi, Maths, Science and
Computer Science in a Double Dimensional Array (DDA) as M[40][5]. When the
teacher enters the name of a student as an input, the program must display the
name, marks obtained in the 5 subjects and the total. Write a program in Java
to perform the task.

31. If arrays M and M + N are as shown below, write a program in Java to find
the array N.

M = {{-1, 0, 2}, M + N = {{-6, 9, 4},


{-3, -1, 6}, {4, 5, 0},
{4, 3, -1}} {1, -2, -3}}

32.Write a program to input a sentence and convert it into uppercase and count
and display the total number of words starting with a letter ‘A’.
Example:
Sample Input: ADVANCEMENT AND APPLICATION OF INFORMATION

TECHNOLOGY ARE EVER CHANGING.


Sample Output : Total number of words starting with letter A’ = 4.
33.Write a program in Java to accept a string in lower case and change the first
letter of every word to upper case. Display the new string.
Sample input: we are in cyber world
Sample output : We Are In Cyber World
34.Special words are those words which starts and ends with the same letter. 
Examples:
EXISTENCE
COMIC
WINDOW
Palindrome words are those words which read the same from left to right and
vice versa
Examples:
MALAYALAM
MADAM
LEVEL
ROTATOR
CIVIC
All palindromes 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.
35.Write a program to accept a string. Convert the string to uppercase. Count and

output the number of double letter sequences that exist in the string.
Sample Input: “SHE WAS FEEDING THE LITTLE RABBIT WITH AN
APPLE”
Sample Output: 4 

You might also like