0% found this document useful (0 votes)
4 views2 pages

Computer

The document outlines holiday homework for Class X (ICSE) in Computer Applications, detailing various programming tasks to be completed using the BlueJ environment. Students are required to write Java programs involving arrays, including tasks such as finding capitals of countries, identifying prime-palindromic numbers, and manipulating matrices. The completed assignments must be submitted by July 15, 2025, in a specified format.

Uploaded by

7929
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Computer

The document outlines holiday homework for Class X (ICSE) in Computer Applications, detailing various programming tasks to be completed using the BlueJ environment. Students are required to write Java programs involving arrays, including tasks such as finding capitals of countries, identifying prime-palindromic numbers, and manipulating matrices. The completed assignments must be submitted by July 15, 2025, in a specified format.

Uploaded by

7929
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Holiday Homework ( Summer Vacation )

Class - X (ICSE) / Computer Applications


Note.
• Programs could be directly coded and tested using BlueJ environment,
• checked executable program should be copied and pasted in the word
document with the output and variable description table, name the file as your
rollno_yourfirstname_assignmentSDA_DDA.docx and to be submitted in the
managebac by the due date 15th July 2025.

Arrays Programs
Q1. Write a program that reads the names of ten countries and their respective capitals into 2
single dimension arrays as given in the list below. The program should accept the name of a
country in the list as an input and give the name of the corresponding capital as output. The
program should be designed so as to give an error message when a country not in the list is
entered as input. To stop program, ‘xxx’ is to be entered as input.

Country Capital
AFGHANISTAN KABUL
DENMARK COPENHAGEN
FINLAND HELSINKI
HONGKONG VICTORIA
IRAQ BAGHDAD
KENYA NAIROBI
NEW ZEALAND WELLINGTON
NIGERIA LAGOS
SINGAPORE SINGAPORE
SOUTH AFRICA CAPE TOWN

[Link] a program to find the following data from the given data list:

a. The largest and the smallest elements in an array;


b. Product of the odd numbers;
c. Sum of the even numbers

Data list: 17, 20, 24, 29, 16, 87, 19, 52

Q3. Develop a program to count duplicate elements from an array, i.e. If any particular
elements repeat twice or thrice in the sequence, count the frequency and print the total
occurrence. Do not print the elements which occurs only once. [Array size – 10]

Ex. List : 10, 7, 10, 5, 7, 4, 10, 3, 2 , 1

Output :10 – 3 times, 7 – 2 times and so on.

Q4. Write a program to input 20 numbers in single dimension array. Display only the numbers
that are prime-palindrome from the list.
A palindromic prime is a number that is simultaneously palindromic and prime. The
first few palindromic primes are 2, 3, 5, 7, 11, 101, 131, 151, 181, 191, 313, 353, 373,
383, 727, 757, 787….etc.
Q5. Write a program in Java to determine the binary equivalent of a decimal positive
integer.

Example : Input : 2
Output: 10
Input : 20
Output: 10100

Q6. Write a program to store a set of number in an array A and another set of numbers in
array B. Produce a third array C, containing all the elements of array A and B. Display
the resultant array.
Ex. Array A[ ] = 10, 20, 30, 40, 50
B[ ] = 1, 2, 3, 4, 5 then the final array should
C[ ] = 10, 20, 30, 40, 50, 1, 2, 3, 4, 5

Q7. Write a program to display and store only the first 20 Prime-palindromic number in
the range 2 – 1000 (inclusive of 2).

A prime- palindromic number is a number that is simultaneously palindromic and prime.


The first few palindromic primes are 2, 3, 5, 7, 11, 101, 131, 151, 181, 191, 313, 353, 373,
383, 727, 757, 787, …etc.

Q8. Write a Java program to find the sum of all the elements which lie on either diagonal.
For example, for the matrix shown below, your program should output 68 =
(1+6+11+16+4+7+10+13)
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16

9. Write a program Lower-left-half which takes a two-dimensional array A, with size


N rows and N columns as argument and prints the lower left-half.
23150
71531
25781
01501
34915
The output Lower left-half.
2
71
257
0150
34915
10. Write a program Upper-right-half which takes a two-dimensional array A, with size N
rows and N columns as argument and prints the lower left-half.
23150
71531
25781
01501
34915
The output Lower left-half.
23150
1531
781
01
5
Happy Holidays

You might also like