You are on page 1of 4

St.

Francis School (ICSE)


Koramangala, Bengaluru-34
Class X - Academic Year 2023-24
PROGRAMS TO BE DONE IN BLUEJ AND TO BE WRITTEN IN COMPUTER RECORD BOOK.
1. Write a menu driven program to generate the uppercase letters from Z to A and lowercase
letters from ‘a’ to ‘z’ as per the user’s choice. Enter 1 to display uppercase letters from Z to A
and Enter ‘2’ to display lowercase letters from ‘a’ to ‘z’.
2. Write a program in Java to display the pattern –
A*B*C*D*E*
A*B*C*D*
A*B*C*
A*B*
A*
3. Special words are those words which start and end with the same letter.
Example : EXISTENCE, COMIC, WINDOW
Palindrome words are those words which read the same from left to right and vice-versa.
Example: MALAYALAM, MADAM, LEVEL
All palindromes are special words but all special words are not palindromes.
WAP to accept a word. Check and display whether the word is a palindrome or only a special
word or none of them.
4. WAP to enter a sentence. Frame a word by joining all the first characters of each word of the
sentence. Display the word.
Sample Input : Vital Information Resource Under Seize.
Sample Output : VIRUS
5. Write a program to generate a triangle or an inverted triangle based upon User’s choice.
If choice is 1, then display the following triangle
B
L L
UUU
E E E E
J J J J J
If choice is 2, then display the following triangle
BLUEJ
BLUE
BLU
BL
B
6. Write a menu driven program to accept an array of 10 numbers and
(i) Print the sum of all even numbers in the array.
(ii) Print those numbers which are divisible by 3.

(iii) Print all the buzz numbers.


7. WAP to input and store roll numbers, names and marks in 3 subjects of n number of students in 5
single dimensional arrays and display the remark based on average marks as given below-

Average Marks Remark


85 - 100 Excellent
75 - 84 Distinction
60 - 74 First Class
40 - 49 Pass
Less than 40 Poor

Output

Roll No Name Remark


****** ****** *******
1002 Ria Pass
2345 Raj Poor
2346 Janvi First Class
1234 Mythri Excellent
1009 Betty Distinction

8. WAP to input the names of 10 students in a single dimensional array. Now, enter a student
name and using linear search, search it in the given list of names. If name present, display
“Search Successful” else display “Search unsuccessful”.
9. Write a program to accept 10 different numbers in a Single Dimensional Array (SDA), in
ascending order. Now, enter a number and by using binary search technique, check whether
number is present or not in the list of array elements. If the number is present, then display
the message “Search Successful”, otherwise display “Search Unsuccessful” with their position
in the array.
a[0] a[1] a[2] a[3] a[4] a[5] a[6] a[7] a[8] a[9]
12 31 42 45 64 65 76 81 87 92
Sample Output:
Enter a number to be searched: 87
Search successful and the number is present in position 9.
10. Write a program to accept 10 different integers in a Single Dimensional Array (SDA). Arrange
the numbers in ascending order by using “Selection Sort” technique and display them.

11. Define a class to accept values into a double array of size 20 and print the range of the array,
the range is the difference between the largest and the smallest elements of the array.

12. Write a program in Java to store 10 words in a Single Dimensional Array (SDA). Display only
those words which are palindrome.
Sample Input: MADAM, TEACHER, REFER, SUNLIGHT, NOON, DAD, PLANT, MOM, MAGIC,
CHALK.
Sample Output: MADAM
REFER
NOON
DAD
MOM
13. Design a class to overload the method display() as follows :
void display() – to print the format 1
2 3
4 5 6
7 8 9 10
boolean display(int n) – to check whether the number entered is a Duck Number or not.
[A number is said to be duck if the digit zero (0) is present in it. (The number must not begin
with zero) The program displays the message accordingly.
Sample Input : 5063
Sample Output : It is a Duck Number
Sample Input : 7453
Sample Output : It is not a Duck Number ]
14. Design a class to overload a function area () as follows:
double area(double a, double b, double c) with three double arguments, returns the area of
scalene triangle using the formula:
(𝑎+𝑏+𝑐)
area = √𝑠 (𝑠 − 𝑎) (𝑠 − 𝑏)(𝑠 − 𝑐) where s = 2

double area(int a, int b, int height) with three integer arguments, returns the area of a
trapezium using the formula :
1
area = 2 ∗ ℎ𝑒𝑖𝑔ℎ𝑡 ∗ (𝑎 + 𝑏)

double area(double diagonal1, double diagonal2) with two double arguments, returns the
area of a rhombus using the formula :
1
area = = 2 ∗ 𝑑𝑖𝑎𝑔𝑜𝑛𝑎𝑙1 ∗ 𝑑𝑖𝑎𝑔𝑜𝑛𝑎𝑙2

Need not write the main() method.


15. Write a menu driven program to perform the following:
To display the first n terms of the following series:
1, 3, 5, 7, 9 …………
To find the sum of the following series :
S = (a+1) + (a+2) +…….. (a+n)
[HINT : use two functions – one for display series and other for sum of series]
Note :
✓ Question 1 to 10 already completed.
✓ For the questions 11 to 15, write and submit the record book as and when you finish the
programs.
All these 5 programs must be corrected by 15th September 2023.
✓ The variable names, data types and description of the variables to be written in table
format. [ Tables to be drawn in pencil only ]
✓ Write the input given and the output obtained (under heading OUPUT) when you
executed the program which depicts your program is working.
✓ Write the program neatly in your computer record book and make sure your work is
neat and without any errors.

___________________

You might also like