[go: up one dir, main page]

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

Isc Comp Project

This document outlines a computer science project by Rajiv Seth for ISC 2025, focusing on Java programming. It includes various sections such as project introduction, mini software programs, term projects utilizing inheritance, and practical programming exercises. The project aims to demonstrate Java's features and programming concepts through structured code examples and algorithms.

Uploaded by

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

Isc Comp Project

This document outlines a computer science project by Rajiv Seth for ISC 2025, focusing on Java programming. It includes various sections such as project introduction, mini software programs, term projects utilizing inheritance, and practical programming exercises. The project aims to demonstrate Java's features and programming concepts through structured code examples and algorithms.

Uploaded by

Rajiv Seth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 55

NAME – RAJIV SETH

CLASS – XII – A

ISC COMPUTER
SCIENCE PROJECT

ISC 2025

1|Page
CONTENTS:
SL DESCRIPTION: PAGE
NO: NO:
1. Project Window
2. Introduction
3. MINI SOFTWARE
Synopsis of Software
Mini Software Program
Output
4. 2ND TERM PROJECT
Programs using Inheritance
To calculate perimeter and area of
parallelogram
Accept a student’s name, roll number
and marks free three subjects.
Therefore, print the total marks and
average alongside the information
given by the user using inheritance
and overriding.
Program using Deque
Programs using passing and
returning an object through a
method technique
To accept two times( in hrs and mins),
and then calculate total hours and
minutes
Practical Type Programs
To calculate number of words in a
sentence and number of each word as
2|Page
well
To input a sentence and calculate
number of words that begin and end
with vowel alongside the original
sentence
Spiral Matrix Program
To accept length and starting value,
and print a spiral matrix
Matrix Mirror Program
To accept a matrix and mirror it
5. 1ST TERM PROJECT
Program 1
Program 2
Program 3
Program 4
Program 5
Program 6
Program 7
Program 8
Program 9
Recursion
Program 10
Encryption & decryption
6. LAB COURSE WORK
LCW 1
LCW 2
LCW 3
LCW 4
LCW 5

3|Page
LCW 6
7. CONCLUSION
8. ACKNOWLEDGEMENT
9. WEBLIOGRAPHY & BIBLIOGRAPHY

INTRODUCTION:
Java has become one of the most popular programming languages in the
world, widely used across various fields, from web development to mobile
applications and scientific computing. Developed by Sun Microsystems and
released in 1995, Java introduced the “write once, run anywhere”

4|Page
philosophy that revolutionized software development. Java’s platform
independence, achieved through the Java Virtual Machine (JVM), allows
Java programs to run on any system that has a JVM, making it a versatile
choice for cross-platform applications.
The language’s rich API library and robust security features further
contribute to its appeal, allowing developers to create secure, efficient, and
complex applications. In this project, we explore the capabilities of Java by
developing various programs that demonstrate its features, syntax, and the
efficiency it offers to programmers.

This project encompasses a series of Java programs, each tailored to exhibit


specific programming concepts and structures, such as loops, arrays,
functions, and object-oriented principles like encapsulation, inheritance,
and polymorphism.
These programs aim to illustrate the logical structure and syntax of Java,
showcasing how foundational concepts are applied in real-world scenarios.
Each program includes detailed documentation to explain the logic behind
the code, thereby helping readers understand Java's approach to problem-
solving.
The project not only provides practical insights into the language but also
emphasizes the significance of writing optimized and readable code,
aligning with the broader objectives of the ISC Computer Science
curriculum. Through this collection, we aim to build a strong foundation in
Java programming, contributing to both academic growth and future
endeavors in software development.

PROGRAMS USING INHERITANCE:


Q. To calculate perimeter and area of parallelogram

5|Page
SAMPLE OUTPUT:

CODE:
//Inheritance PROG-1//
import java.util.*;
class Inheritance_extends
{

6|Page
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter the length, breadth, height for the parallelogram: ");
double m1=sc.nextDouble();
double bd=sc.nextDouble();
double h1=sc.nextDouble();
area ob=new area(h1,m1,bd);
ob.show();
}
}

class perimeter
{
double a,b;
perimeter(double x,double y)
{
a=x;
b=y;
}

double calculate()
{
return (2*(a+b));
}

void show()
{
System.out.println("The length of the parallelogram is - " + a);
System.out.println("The breadth of the parallelogram is - " + b);

7|Page
System.out.println("The perimeter of the parallelogram is - " + calculate());
}
}

class area extends perimeter


{
double h,area;
area(double ht, double g,double b)
{
super(g,b);
h=ht;

void doarea()
{
area=b*h;
}

void show()
{
doarea();
super.show();
System.out.println("The height of the parallelogram is - " + h);
System.out.println("The area of the parallelogram is - " +area); }}

ALGORITHM:
1. Start
2. Create the Main Class (`Inheritance_extends`)
- In the `main` method:
- Create an instance of `Scanner` to take user inputs.

8|Page
- Prompt the user to input values for length (`m1`), breadth (`bd`), and height (`h1`) of
the parallelogram.
- Read and store these values in respective variables.
- Create an instance of the `area` class, passing `h1`, `m1`, and `bd` as parameters.
- Call the `show` method on the `area` class object to display results.
3. Define the `perimeter` Class
- Declare two double variables `a` and `b` for the dimensions.
- Create a constructor `perimeter(double x, double y)` that:
- Assigns `x` to `a` and `y` to `b`.
- Define a `calculate` method that:
- Returns the perimeter as `2 * (a + b)`.
- Define a `show` method that:
- Displays the length, breadth, and calculated perimeter of the parallelogram.
4. Define the `area` Class (Inherits from `perimeter`)
- Declare a double variable `h` for height and `area` to store calculated area.
- Create a constructor `area(double ht, double g, double b)` that:
- Calls the superclass constructor with `g` and `b` to initialize `a` and `b`.
- Assigns `ht` to `h`.
- Define a `doarea` method that:
- Calculates the area as `b * h`.
- Override the `show` method:
- Call the `doarea` method to calculate the area.
- Call the superclass `show` method to display length, breadth, and perimeter.
- Display the height and calculated area of the parallelogram.
5. End

OUTPUT:

9|Page
L.O.I:

10 | P a g e
PROGRAMS USING INHERITANCE AND OVERRIDING:
11 | P a g e
Q. Accept a student’s name, roll number and marks free
three subjects. Therefore, print the total marks and average
alongside the information given by the user using
inheritance and overriding.

SAMPLE OUTPUT:

CODE:

12 | P a g e
// INHERITANCE - 2//
import java.util.*;
class StudentMarks { // Main class
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the student's name: ");
String name = sc.nextLine();
System.out.println("Enter the student's roll number: ");
int rollNo = sc.nextInt();

System.out.println("Enter marks for three subjects: ");


double marks1 = sc.nextDouble();
double marks2 = sc.nextDouble();
double marks3 = sc.nextDouble();

Results result = new Results(name, rollNo, marks1, marks2, marks3);


result.show();
}
}

class Student { // Superclass


String name;
int rollNo;

// Constructor to initialize student's name and roll number


Student(String name, int rollNo) {
this.name = name;
this.rollNo = rollNo;
}
// Method to display student details

13 | P a g e
void show() {
System.out.println("Student Name: " + name);
System.out.println("Roll Number: " + rollNo);
}
}

class Results extends Student { // Subclass extending Student


double marks1, marks2, marks3, total, average;

// Constructor to initialize marks and call superclass constructor


Results(String name, int rollNo, double marks1, double marks2, double marks3) {
super(name, rollNo);
this.marks1 = marks1;
this.marks2 = marks2;
this.marks3 = marks3;
}

// Method to calculate total and average marks


void calculate() {
total = marks1 + marks2 + marks3;
average = total / 3;
}

// Overriding show method to display marks, total, and average


@Override
void show() {
super.show();
calculate();
System.out.println("Marks in Subject 1: " + marks1);
System.out.println("Marks in Subject 2: " + marks2);

14 | P a g e
System.out.println("Marks in Subject 3: " + marks3);
System.out.println("Total Marks: " + total);
System.out.println("Average Marks: " + average);
}
}

ALGORITHM:
1. Start
2. Initialize Main Class (StudentMarks)
 In main method:
o Create an instance of Scanner for input.
o Prompt the user to enter the student’s name and roll number.
o Prompt the user to enter marks for three subjects.
o Create an instance of the Results class, passing name, roll number, and
marks as parameters.
o Call the show method on the Results class instance to display the results.
3. Define Student Class (Superclass)
 Declare String name and int rollNo to store student details.
 Create a constructor that initializes name and rollNo.
 Define a show method to display name and rollNo.
4. Define Results Class (Subclass of Student)
 Declare variables marks1, marks2, marks3, total, and average for marks and
calculations.
 Create a constructor to initialize marks and call the superclass constructor.
 Define a calculate method that:
o Computes the total marks as marks1 + marks2 + marks3.
o Calculates the average as total / 3.
 Override the show method to:
o Call the superclass show method.

15 | P a g e
o Call the calculate method.
o Display marks1, marks2, marks3, total, and average.
5. End

OUTPUT:

L.O.I:
16 | P a g e
PROGRAMS USING DEQUE:

17 | P a g e
SAMPLE OUTPUT:

CODE:
import java.util.Deque;

18 | P a g e
import java.util.ArrayDeque;
import java.util.Scanner;

public class DequeProgram {


public static void main(String[] args) {
// Creating a Deque using ArrayDeque
Deque<Integer> deque = new ArrayDeque<>();
Scanner scanner = new Scanner(System.in);

// Display menu to user


while (true) {
System.out.println("\nDeque Operations Menu:");
System.out.println("1. Add to Front");
System.out.println("2. Add to Rear");
System.out.println("3. Remove from Front");
System.out.println("4. Remove from Rear");
System.out.println("5. Display Deque");
System.out.println("6. Exit");
System.out.print("Enter your choice: ");

int choice = scanner.nextInt();


switch (choice) {
case 1:
System.out.print("Enter a number to add to the front: ");
int frontNum = scanner.nextInt();
deque.addFirst(frontNum);
System.out.println(frontNum + " added to the front.");
break;

case 2:

19 | P a g e
System.out.print("Enter a number to add to the rear: ");
int rearNum = scanner.nextInt();
deque.addLast(rearNum);
System.out.println(rearNum + " added to the rear.");
break;

case 3:
if (!deque.isEmpty()) {
int removedFront = deque.removeFirst();
System.out.println(removedFront + " removed from the front.");
} else {
System.out.println("Deque is empty. Nothing to remove.");
}
break;

case 4:
if (!deque.isEmpty()) {
int removedRear = deque.removeLast();
System.out.println(removedRear + " removed from the rear.");
} else {
System.out.println("Deque is empty. Nothing to remove.");
}
break;

case 5:
System.out.println("Current Deque: " + deque);
break;

case 6:
System.out.println("Exiting...");

20 | P a g e
scanner.close();
return;

default:
System.out.println("Invalid choice. Please enter a valid option.");
}
}
}
}

ALGORITHM:
Algorithm
1. Initialize the Program:
o Create a Deque instance deque using ArrayDeque.
o Create a Scanner instance scanner to take input from the user.
2. Display Menu and Take User Input:
o Use a loop to continuously display the menu until the user decides to exit.
o Show options for adding, removing, peeking, displaying elements, and
exiting.
3. Handle User Choice:
o Based on the user’s choice, perform the respective operation on the
deque:
Option 1 - Add to Front:
o Prompt the user to enter a number to add.
o Use addFirst(element) to add the number to the front of deque.
o Display a confirmation message.
Option 2 - Add to Rear:
o Prompt the user to enter a number to add.
o Use addLast(element) to add the number to the rear of deque.
o Display a confirmation message.

21 | P a g e
Option 3 - Remove from Front:
o Check if deque is not empty.
o If not empty, use removeFirst() to remove the front element.
o Display a message showing the removed element.
o If empty, display an error message.
Option 4 - Remove from Rear:
o Check if deque is not empty.
o If not empty, use removeLast() to remove the rear element.
o Display a message showing the removed element.
o If empty, display an error message.
Option 5 - Display Deque:
o Display the entire deque to show the current elements.
Option 6 - Exit:
o Close the scanner and end the program.
4. Invalid Choice:
o If the user enters an invalid choice, display an error message and prompt
again.
5. Repeat Steps 2-4 until the user selects the "Exit" option.

OUTPUT:

22 | P a g e
L.O.I:

23 | P a g e
24 | P a g e
Programs using passing and returning an object
through a method technique:
Q. To accept two times( in hrs and mins), and then calculate
total hours and minutes

SAMPLE OUTPUT:

25 | P a g e
CODE:
//OBJECT PASSING//
import java.util.*;
class Adder
{
int a[];
Adder()
{
a = new int[2];
}

void readtime()
{
Scanner sc = new Scanner (System.in);
System.out.println(":: Time ::");
System.out.print("\nEnter hour: ");
a[0] = sc.nextInt();
System.out.print("\nEnter minute: ");
a[1] = sc.nextInt();
}

void addtime(Adder x, Adder y)


{
a[0]=x.a[0]+y.a[0]+(x.a[1]+y.a[1])/60;
a[1]=(x.a[1]+y.a[1])%60;
}

void disptime()
{
System.out.print("total:- ");

26 | P a g e
System.out.print("hours= " + a[0] +" minutes= " + a[1]);
}

public static void main(String args[ ])


{
Adder obj1 = new Adder();
Adder obj2 = new Adder();
Adder sumObj = new Adder();
obj1.readtime();
obj2.readtime();
sumObj.addtime(obj1, obj2);
sumObj.disptime();
}
}

ALGORITHM:
 Define the Adder Class:
 Declare an integer array a of size 2 to store hours and minutes.
 Initialize the Constructor:
 Inside the constructor Adder(), initialize a to an array of size 2.
 Define readtime() Method:
 Create a Scanner object for user input.
 Display a prompt to enter hours and store it in a[0].
 Display a prompt to enter minutes and store it in a[1].
 Define addtime(Adder x, Adder y) Method:
 Compute the total hours and minutes by accessing the a array of both Adder
objects x and y.
 Calculate the total hours by adding x.a[0] and y.a[0] and adding the carryover
from minutes if they exceed 60.
 Calculate the total minutes using the modulus operation (x.a[1] + y.a[1]) % 60 to
handle overflow.

27 | P a g e
 Define disptime() Method:
 Print the total time in hours and minutes by accessing the a array.
 Main Method:
 Instantiate three Adder objects: obj1, obj2, and sumObj.
 Call readtime() on obj1 to input the first time.
 Call readtime() on obj2 to input the second time.
 Call addtime(obj1, obj2) on sumObj to compute the total time by passing obj1
and obj2 as arguments.
 Call disptime() on sumObj to display the result.

OUTPUT:

28 | P a g e
L.O.I

29 | P a g e
Practical Program 1:
To calculate number of words in a sentence and number of
each word as well

SAMPLE OUTPUT:

30 | P a g e
CODE:
//ISC PRAC 2//
import java.util.*;
class string_2010
{
void accept()
{
Scanner sc=new Scanner(System.in);
System.out.println("INPUT: ");
System.out.println("Enter sentence. ");
String s=(new Scanner(System.in)).nextLine();
String nw="";
int c=0;
int i=0;

for( i=0;i<s.length();i++)
if((Character.isLetter(s.charAt(i)))||(s.charAt(i)==' '))
nw+=s.charAt(i);
else
nw+=" ";

StringTokenizer ob=new StringTokenizer(nw);


String z="";
String wrd[]=new String[ob.countTokens()];
int count[]=new int[ob.countTokens()];
System.out.println("OUTPUT");
System.out.println("\n Total number of words : "+ob.countTokens());
i=0;
while(ob.hasMoreElements())
{

31 | P a g e
c=0;
String w=ob.nextToken();
if(z.indexOf(w)==-1)
{
StringTokenizer ob1=new StringTokenizer(nw);
while(ob1.hasMoreElements())
{
String wd=ob1.nextToken();
if(wd.equals(w))
c++;
}
z=z+w+" ";
wrd[i]=w;
count[i]=c;

i++;
}
}
sort(wrd,count);
}

void sort(String a[],int c[])


{
for(int i=0;i<c.length;i++)
{
int min=i;
for(int j=i+1;j<c.length;j++)
{
if(c[min]>c[j])
min=j;

32 | P a g e
}
String t=a[min];
a[min]=a[i];
a[i]=t;
int k=c[min];
c[min]=c[i];
c[i]=k;

}
display(a,c);
}

void display(String a[],int c[])


{
System.out.println("\n WORD FREQUENCY");
for(int i=0;i<c.length;i++)
{
if(a[i]!=null)
{
String t=a[i];
System.out.print(" "+t);
for(int j=1;j<=20-t.length();j++)
System.out.print(" ");
System.out.println(c[i]);
}
}
}

public static void main(String args[])


{

33 | P a g e
string_2010 ob=new string_2010();
ob.accept();
}
}

ALGORITHM:
 Define the Class and Method Structure:
 Define a class string_2010 with methods accept(), sort(), and display().
 Define the accept() Method:
 Initialize Scanner to get user input.
 Prompt the user to enter a sentence.
 Initialize variables:
o s to store the sentence input.
o nw to build a new string that replaces all non-letter characters with
spaces.
o c and i as counters for later use.
 Process the Sentence:
o For each character in s, if it is a letter or a space, add it to nw. Otherwise,
add a space.
 Tokenize the String:
 Use StringTokenizer on nw to create tokens (words) separated by spaces.
 Initialize:
o wrd array to store unique words.
o count array to store the frequency of each unique word.
 Print the total number of words using countTokens().
 Count Word Frequency:
 Initialize an empty string z to keep track of processed words.
 For each unique word w in the tokens:
o If w is not in z, calculate its frequency:
 Create another StringTokenizer for nw and count occurrences of w.
 Add w to z.

34 | P a g e
 Store w in wrd and its frequency in count.
 Increment i for each unique word.
 Sort Words by Frequency:
 Call sort(wrd, count) method to sort words by frequency in ascending order.
 Use a selection sort algorithm:
o Find the minimum element in count[] and swap it with the current
position.
o Perform the same swap in wrd[] to keep words and frequencies aligned.
 Display Results:
 Call display(wrd, count) to print words and their frequencies.
 For each word in wrd:
o Align the output by adding spaces after each word to format columns.
o Print the word and its frequency from count.
 Main Method:
 Instantiate string_2010 and call accept() to start the program.

OUTPUT:

35 | P a g e
L.O.I:

36 | P a g e
PRACTICAL PROGRAM 2:
To input a sentence and calculate number of words that
begin and end with vowel alongside the original sentence

SAMPLE OUTPUT:

37 | P a g e
CODE:

import java.util.*;
class string_2016
{
String a[];
String b[];
int c=0;
int t=0;
void accept()
{
Scanner sc=new Scanner(System.in);
System.out.print("\nINPUT: ");
String s=sc.nextLine();
char l=s.charAt(s.length()-1);
if(".?".indexOf(l)==-1)
{
System.out.print("\n OUTPUT: ERROR");
System.exit(0);
}
s=s.substring(0,s.length()-1);
StringTokenizer ob=new StringTokenizer(s);
a=new String[ob.countTokens()];
b=new String[ob.countTokens()];
while(ob.hasMoreTokens())
{
String w=ob.nextToken();
if(("AEIOU".indexOf(w.charAt(0))!=-1)&&("AEIOU".indexOf(w.charAt(w.length()-
1))!=-1))
{

38 | P a g e
a[c++]=w;
}
else
{
b[t++]=w;
}
}
System.out.println("OUTPUT:");
System.out.println("\nNUMBER OF WORDS END AND BEGIN WITH VOWELS: "+c);
for(int i=0;i<c;i++)
System.out.print(a[i]+" ");
for(int i=0;i<t;i++)
System.out.print(b[i]+" ");
}

public static void main(String args[])


{
string_2016 ob=new string_2016();
ob.accept();
}
}

39 | P a g e
ALGORITHM:
 Define the Class and Initialize Variables:
 Define a class string_2016 with arrays a and b to store words that meet specific
criteria.
 Initialize integer counters c and t to 0. c counts words starting and ending with
vowels, and t counts other words.
 Define accept() Method:
 Create a Scanner object to read user input.
 Input Sentence:
o Prompt the user to input a sentence.
o Retrieve the last character of the input sentence.
o Check if the last character is a period (.) or question mark (?).
 If not, print an error message, output "ERROR", and exit the
program.
o Remove the punctuation mark from the end of the sentence.
 Tokenize the Sentence:
 Use StringTokenizer on the modified sentence to split it into words.
 Initialize arrays a and b to store words according to the total token count.
 Process Each Word:
 For each word token:
o Check if the word starts and ends with a vowel (i.e., if the first and last
characters are vowels).
 If True:
 Store the word in array a.
 Increment the vowel count c.
 If False:
 Store the word in array b.
 Increment the other word count t.
 Display Results:
 Print the total number of words that both start and end with vowels.
 Print each word in array a (words that start and end with vowels).

40 | P a g e
 Print each word in array b (remaining words).
 Main Method:
 Instantiate string_2016 and call accept() to start the program.

OUTPUT:

41 | P a g e
L.O.I:

42 | P a g e
SPIRAL MATRIX PROGRAM:
Q. To accept length and starting value, and print a spiral
matrix

SAMPLE OUTPUT:

43 | P a g e
CODE:
//SPIRAL MATRIX//
import java.util.*;
class DDASpiral_fill_given_number
{
int a[][],m;
DDASpiral_fill_given_number(int m1)
{
m=m1;
a=new int[m][m];
}

void print()
{
Scanner sc = new Scanner(System.in);

for(int i=0; i<m; i++)


{
for(int j=0; j<m; j++)
System.out.printf("%4d",a[i][j]);
System.out.println(" ");
}
}

void Spiral(int s1)


{

int i,j,k;
int s=s1;
for(i=0,j=m-1;i<m/2;i++,j--)

44 | P a g e
{
for(k=i;k<j;k++)
a[i][k]=s++;

for(k=i;k<j;k++)
a[k][j]=s++;

for(k=j;k>i;k--)
a[j][k]=s++;

for(k=j;k>i;k--)
a[k][i]=s++;

}
a[i][j]=s++;
}

public static void main()


{
Scanner sc = new Scanner(System.in);
System.out.println("Enter the size");
int cap = sc.nextInt();
System.out.println("Enter the starting value");
int s = sc.nextInt();
DDASpiral_fill_given_number ob = new DDASpiral_fill_given_number(cap);
ob.Spiral(s);
ob.print();
}
}

45 | P a g e
ALGORITHM:
 Define the Class and Constructor:
 Define a class DDASpiral_fill_given_number.
 In the constructor, initialize m to the provided matrix size (m1).
 Create a 2D integer array a of size m×mm \times mm×m to represent the matrix.
 Define the print() Method:
 Loop through each row of the matrix a.
 For each element in the row, print it with formatting for alignment.
 Define the Spiral(int s1) Method:
 Initialize variables:
o i and j to represent the current layer and end index of the layer in the
matrix.
o s as the starting integer value (s1).
 Loop through Layers:
o For each layer:
 Move from the left to the right in the top row and assign increasing
values of s.
 Move from the top to the bottom in the right column and assign
increasing values of s.
 Move from the right to the left in the bottom row and assign
increasing values of s.
 Move from the bottom to the top in the left column and assign
increasing values of s.
o After finishing all layers, place the next value of s in the center cell if the
matrix size is odd.
 Define the main() Method:
 Prompt the user to input the matrix size cap and the starting number s.
 Instantiate an object ob of DDASpiral_fill_given_number with size cap.
 Call Spiral(s) to fill the matrix in a spiral order starting with s.
 Call print() to display the filled matrix.

46 | P a g e
OUTPUT:

47 | P a g e
L.O.I:

MATRIX MIRROR:

48 | P a g e
Q. To accept a matrix and mirror it.

SAMPLE OUTPUT:

CODE:

49 | P a g e
// accept a n x n matrix, display it in Mirror form//
import java.util.*;
class mirror_matrix
{
public static void main()
{

int i,j,n;
Scanner sc=new Scanner (System.in);
System.out.println("Enter size of matrix ");
n=sc.nextInt();
int arr[][] = new int[n][n];
System.out.println("Enter matrix");
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
arr[i][j]=sc.nextInt();
}

}
System.out.println("display original matrix");
for (i=0; i<n; i++)
{
for (j=0; j<n; j++)
System.out.print(arr[i][j] +" ");

System.out.println();
}

50 | P a g e
System.out.println("display matrix in Mirror Form");
for (i=0; i<n; i++)
{
for (j=n-1; j>=0; j--)
System.out.print(arr[i][j] +" ");

System.out.println();
}

}
}

ALGORITHM:
 Initialize Variables:
 Create variables i, j, and n.
 Initialize a Scanner object for user input.
 Input the Matrix Size:
 Prompt the user to enter the size of the matrix.
 Store the input in n.
 Define and Populate the Matrix:
 Declare a 2D integer array arr of size n×nn \times nn×n.
 Prompt the user to enter elements for the matrix.
 Use nested loops to fill each element in arr:
o Outer loop for each row (i from 0 to n-1).
o Inner loop for each column (j from 0 to n-1).
o Store the input value at arr[i][j].
 Display the Original Matrix:
 Use nested loops to print each element in the original matrix:
o Outer loop iterates through each row (i from 0 to n-1).
o Inner loop iterates through each column (j from 0 to n-1).

51 | P a g e
o Print each element arr[i][j] with a space for formatting.
 Print a newline after each row to maintain the matrix format.
 Display the Matrix in Mirror Form:
 Use nested loops to print each element in mirrored form:
o Outer loop iterates through each row (i from 0 to n-1).
o Inner loop iterates through each column in reverse order (j from n-1 to 0).
o Print each element arr[i][j] with a space for formatting.
 Print a newline after each mirrored row.

OUTPUT:

52 | P a g e
l.O.I:

PROJECT DASHBOARD:

53 | P a g e
CONCLUSION:
This ISC Computer Science project aimed to develop a robust application using Java,
focusing on achieving efficiency, user-friendliness, and reliability. Through the project, I
designed and implemented [mention project purpose, e.g., "a Student Management
System" or "a Library Inventory System"] to handle essential tasks like [mention key
functions, e.g., "record management, search functionality, and data validation"]
effectively.

By employing object-oriented principles such as encapsulation, inheritance, and


polymorphism, the project is modular and scalable, allowing for easy future
enhancements. Implementing this project presented certain challenges, such as
[mention challenges, e.g., "handling input validation, managing data storage, or ensuring
smooth error handling"]. Addressing these challenges improved my understanding of
Java’s error-handling mechanisms and reinforced the importance of writing clean,
maintainable code.

Additionally, the project offered valuable hands-on experience with key Java tools and
libraries, including [mention any libraries if applicable, e.g., "JavaFX for a user interface
or JDBC for database connectivity"], deepening my technical knowledge and helping
bridge the gap between theory and application.

In conclusion, this project not only met its objectives but also served as a significant
learning experience, enhancing both my programming skills and my problem-solving
abilities. I look forward to further improving the application by [mention possible future
improvements, e.g., "adding more features, optimizing performance, or integrating with
other technologies"], which could make it even more efficient and practical for real-
world use.

54 | P a g e
ACKNOWLEDGEMENT:
I would like to express my special thanks of gratitude to our
respected principal Mr. T. H Ireland and our Physics teacher, Mr. B.
Dasgupta who gave us the wonderful opportunity to work on this
project and aided me in analysing this project. Their guidance
clarified my understanding, expanded my knowledge and
highlighted the significance of the project.
I would also like to thank my parents and friends who helped me in
finalizing this project within the limited time frame.

WEBLIOGRAPHY & BIBLIOGRAPHY:


1. www.wikipedia.org
2. www.geeksforgeeks.com
3. www.javapoint.com
4. www.knowledgeboat.com
5. UNDERSTANDING ISC COMPUTER SCIENCE
6. COMPUTER SCIENCE WITH JAVA

55 | P a g e

You might also like