Term-I Project
Term-I Project
Term-I Project
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.
(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)
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
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]
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
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.
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
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