Assignments- Class Xi Computer Science
Assignments- Class Xi Computer Science
CLASS-XI
SUBJECT-COMPUTER SCIENCE
ASSIGNMENT
[SL NO - 6 TO 15]
6) Write a Java program to get a day of the week on a specific date.
8) Write a program to input a line of text and print the biggest word (length wise) from it.
Sample input: I live in Kolkata
Sample output: Kolkata
9) Write a program to input a sentence. Count and display the frequency of each letter of
the sentence in alphabetical order.
Sample Input: COMPUTER APPLICATIONS
Sample Output:
Character Frequency Character Frequency
A 2 O 2
C 2 P 3
I 1 R 1
L 2 S 1
M 1 T 2
N 1 U 1
10) Write a program in Java to enter natural numbers in a double dimensional array m x
n (where m is the number of rows and n is the number of columns). Display the new
matrix in such a way that the new matrix is the mirror image of the original matrix.
8 15 9 18
9 10 7 6
10 8 11 13
12 16 17 19
Sample Input
18 9 15 8
6 7 10 9
13 11 8 10
19 17 16 12
Sample Output
11) Write a Program in Java to input elements in a 2-D square matrix and check
whether it is a Scalar Matrix or not.
ScalarMatrix: A scalar matrix is a diagonal matrix where the left diagonal elements are
same.
12) Design a class matrix that contains a 2D array of order [n * n ]. The maximum value
possible for n is 20. The details of some of the members of the class are given below
Member functions:
matrix(…..) : parameterized constructor to initialize n and to allocate
memory to member array
void fnGet() : to fill the member array
void fnDisplay() : to show the member matrix
matrixfnTrans(matrix A) : to store the transpose of the argument matrix in the current
object and return that.
Specify the class matrix giving the details of the above member data and methods only.
13) Write a java program to check whether a number is Palindrome or not by using
recursion.
15) Write a Java Program to Find the Sum of Natural Numbers using Recursion.
Instructions :