(Paper) ICSE Important Questions : Computer Application (2009) Part -3
Disclaimer: This website is NOT associated with CBSE, for official website of CBSE visit - www.cbse.gov.in
Paper : ICSE Important Questions : Computer Application (2009) Part - 3
Q. 1. Write a program to display the upper half of a 2D array If arr [][] is
2 3 1 5 0
Output 2 3 1 5 0
9 5 3 2 5
5 3 2 5
7 5 9 2 4 9
2 4
7 3 4 9 5
9
5
8 3 0 4 5
5
Q. 2. Write a program to display hcf and lcm of any two nos.
Q. 3. Write a program which inputs a positive natural no N and output all combinations of consecutive naturals which add up to give N. Example if N = 15 then output should be
1 2 3 4 5
4 5 6
7 8
Q. 4. Write a program to read a positive integer from the console and find out whether it is automorphic or not.
(Automorphic numbers are those which are found on the extreme right side of their square).
Eg. 52 = 25, 62 = 36, 252 = 625 . 5,6,25 are automorphic numbers
Q. 5. Write a program to accept a sentence from the user and print out the frequency of each letter.
Q. 6. The length() method of string class returns the number of characters in a given string. However , here you have to develop a method OnlyChars() that should return the count of characters excluding the spaces in a string.
Q. 7. Write a method namely Countwords() that should receive a string and return the numbers of words in thepresent string.
Q. 8. Write a method namely ReverseStr() that receive a string and returns the reversal string. Don’t use library functions for reversing.
Q. 9. Write a method namely Revwords() of class strings that should receive a string and return the strings with its words reversed individually e.g. if you pass “ I love Java”, it should return “ I evol avaJ”
Q. 10. Write a method in java to calculate thr value of the following series :
S = (1 +2 )/(1 * 2) + (1 +2 + 3)/(1 * 2 * 3) +.........+ (1 +2 +3 +4 +...........+n)/(1*2*3*............*n)
Q. 11. Wap in java to store elements in a matrix and perform the following
- Whether matrix is strictly symmetricor not. A matrix is said to be symmetric if and only if it is a squarematrix and it is equal to its transpose
- Find total number of prime elementsfrom the matrix
- Find the sum of the elements whichlies above the main diagonal
Q. 12. Write a program to input a string and display the string with the first character of every word in capital and the rest of the word in small letters.
Q. 13. write a method to find out the total number of prime and palindrome numbers from a range of numbers.
Q. 14. write a program in java to read a number having more than 5 digits and print whether the given number is divisible by 11 or not. A number is divisible by 11 if and only if the difference of the sums of digits at odd positions and even positions is either zero or divisible by 11
Q. 15. Define a class salary described as below:
Data members: name, Address, Phone, Subject Specialization , Monthly Salary , Income Tax
Member methods:
- To accept the details of a teacher including the monthly salary
- To display the details of the teacher.
- To compute the annual Income Tax as 5% of the annual salary above Rs. 1,75,000/-
Write a main method to create object of a class and call the above member method.
Q. 16. Write a program to initialize the given data (2,5,4,1,3) in an array and find out the minimum and maximum values along with the sum of the given elements.
Q. 17. Write a program to input twenty names in an array and display all the names whose first alphabet matches with the alphabet entered by the user.
Q. 18. Write a program using string function to input any string and print the same in alphabetical order.
Q. 19. Write a program to enter a sentence and display the following.
- Number of upper case vowels
- Number of lower case vowels
- Number of digits
- Number of consonants
- Number of blank spaces
- Number of special character
Q. 20. Input the index number and name of boys appearing in the coming ICSE Examination and print the list with index numbers in a sequence. Also make sure while entering the index numbers that no index should be repeated.
Q. 21. Define a class named sentence with a data member named s, string type and the following methods:
- Sentence(string)-to assign an initial value to s
- Countword()-to count and return the number of words in the sentence
- Palindrome()-to test whether the sentence is a palindrome and return true or false.s