0% found this document useful (0 votes)
2 views

Assignments- Class Xi Computer Science

The document is an assignment for Class XI Computer Science at Douglas Memorial Higher Secondary School, detailing programming tasks in Java. It includes tasks such as calculating the day of the week for a specific date, identifying happy numbers, finding the largest word in a sentence, and working with matrices. Instructions for formatting and presenting the project are also provided.

Uploaded by

tombro202020
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Assignments- Class Xi Computer Science

The document is an assignment for Class XI Computer Science at Douglas Memorial Higher Secondary School, detailing programming tasks in Java. It includes tasks such as calculating the day of the week for a specific date, identifying happy numbers, finding the largest word in a sentence, and working with matrices. Instructions for formatting and presenting the project are also provided.

Uploaded by

tombro202020
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

DOUGLAS MEMORIAL HIGHER SECONDARY SCHOOL

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.

7) Write a program to determine whether a number is happy number or not.


The happy number can be defined as a number which will yield 1 when it is replaced
bythe sum of the square of its digits repeatedly. If this process results in an endless
cycle of numbers containing 4, then the number is called an unhappy number.
For example, 32 is a happy number as the process yields 1 as follows
32 + 22 = 13
12 + 32 = 10
12 + 02 = 1

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

Class name : matrix


Data members:
int t[][] : to store the matrix
int n : integer to store the number of rows and columns

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.

14) Write a Java Program to Find G.C.D Using Recursion

15) Write a Java Program to Find the Sum of Natural Numbers using Recursion.

Instructions :

 The project should be printed in A4 size sheet covered by a channel file


 (Program no 6 to program no 15)
 Make a cover page containing full information of the student
 All programs should have the following points-
 Question
 Algorithm
 Coding with Comments
 Variable description
 Output

You might also like