Professional Documents
Culture Documents
Computer Project Soumyadeep Das
Computer Project Soumyadeep Das
Computer Project Soumyadeep Das
CLASS – XI SECTION– B
ROLL– 21
SUBJECT – COMPUTER APPLICATION
INTRODUCTION:
BlueJ is an integrated development environment (IDE) for the java programming
language ,developed mainly for educational purposes, but also suitable for small-
scale software development.It runs with the help of JDK (Java Development Kit).
BlueJ was developed to support the learning and teaching of object- oriented
programming and its design differs from other development environments as a
result. The main screen graphically shows the class structure of an application under
development (in a UML-like diagram), and objects can be interactively created and
tested.This interaction facility, combined with a clean, simple userinterface, allows
easy experimentation with objects underdevelopment.Object-oriented concepts
(classes, objects, communication through method calls) are represented visually and
in its interaction design in the interface.
HISTORY:
The development of BlueJ was started in 1999 by Michael Kölling and John
Rosenberg at Monash University, as a successor to the Blue[3] system. BlueJ is an IDE
(Integrated Development Environment). Blue was an integrated system with its own
programming language and environment, and was a relative of the Eiffel language.
BlueJ implements the Blue environment design for the Java programming language.
In March 2009, the BlueJ project became free and open source software, and
licensed under GPL-2.0-or-later with the Classpath exception.
FUNCTIONALITY:
BlueJ has a simpler interface than most professional IDEs, but its functionality is not a
subset of those kinds of environment. While many of the standard development
tools exist, such as an editor, compiler and runtime environment, it also offers tools
that are specific to its educational goals and not found in this form in common
professional environments. These includes interactive object creation and method
invocation (via the "Object Bench"), simplified debugging and teamwork controls,
interactive, line-based expression and statement evaluation (via the "Code Pad"),
and automated creation of JUnit classes from recordings of interactive test
sequences.
In this project, I took the target to complete forty programs with its necessary details
by the help of above mentioned software.
INDEX
SL NO. PROGRAM NAME PAGE NO
1
2
3
4
5
6
7
8
9
10
PROGRAM 1
BASIC MATRIX PROGRAM
Question
WAP in Java to accept a m x n matrix and print the sum of each row and column at
the end of each row and column.
Algorithm
Step 1: Start.
Code
import java.util.*;
public class sumMatrix
{
public static void main (String args[])
{
Scanner sc = new Scanner (System.in);
System.out.println("Enter the number of rows and columns");
int m = sc.nextInt();
int n = sc.nextInt();
int arr[][] = new int [m][n];
System.out.println("Enter "+(m*n) +" elements for the matrix");
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
arr[i][j] = sc.nextInt();
}
}
int sum = 0, row = 0, col = 0;
System.out.print("\t\t");
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
System.out.print(arr[i][j] + " ");
sum = sum + arr[i][j];
row = row + arr[i][j];
}
System.out.print("Row Sum = " + row + "\n\t\t");
row = 0;
}
System.out.print("\nColumn sums = ");
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
col = col + arr[j][i];
}
System.out.print(col + " ");
col = 0;
}
System.out.println("\n\nThe sum of the elements of the array is "+sum);
}
}
Output
Variable Description
Sl. Data Name Purpose
no Type
1 int [ ] [ ] arr Accepting the array
2 int m Taking the number of rows
3 int n Taking the number of columns
4 int row Calculating the sum of the rows
5 int col Calculating the sum of the columns
6 int sum Calculating the sum of whole matrix
Program 2:
Sum of Diagonals
Question
WAP in Java to accept a m x n matrix and print the sum of each row and column at
the end of each row and column.
Algorithm
Step 1: Start.
Algorithm
Step 1: Start.
Code
import java.util.*;
public class boundary
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter the number of rows and columns");
int m = sc.nextInt();
int n = sc.nextInt();
int arr[][] = new int [m][n];
System.out.println("Enter "+(m * n)+" elements for the array");
for ( int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
arr[i][j] = sc.nextInt();
}
}
System.out.println("The array");
for ( int i = 0; i < m; i++)
{
Code
import java.util.*;
int n;
Perfect(int m){
n = m;
int sum_of_factor(int a) {
int s = 0;
if ( a % i == 0 ){
s = s + i;
return s;
boolean isperfect() {
if (sum_of_factor(n) == n)
{
return true;
else
return false;
void check()
if ( isperfect() == true ) {
else
int x;
x = sc.nextInt();
obj.check();
}
Output
Program 5
Disarium
Question
Write a program to check whether a number is a disarium number or not while using
the following details: -
Member Functions: -
Int count_digit (int): to count and return the no. of digits of the given number
int sum_of_digits(int): will return the sum of the digits by power of each digit by
calling count_digit (int)
boolean check (): will check and return true if disarium else false
Implement the main function to call the method and print the appropriate message.
Algorithm
Algorithm for the constructor disarium (int m)
Step 2: Declare a variable to store num to ensure value of num is not changed.
Step 2: Check whether number is less than 10. If so, return the value of that number
raised to single power. In other words, if the number is single digit, then raise it to the
power 1.
If not, then the last digit of the number is being raised to power 1 and the rest is being
sent to the same function by recursion so that the rest is treated as a number and the
same process is followed.
Step 2: Checks if the entered number and the number returned by the sum of digits
function is same or not.
Code
import java.util.*;
int num,size;
disarium(int n)
num=n;
size=0;
}
void countDigit()
int i=num;
while (i!=0)
int d= i%10;
size++;
i=i/10;
if(n<10)
return((int)Math.pow(n,p));
else
int t=((int)Math.pow(n%10,p));
return(t+sumofdigits(n/10,--p));
void check()
if(num==sumofdigits(num,size))
{
else{
int m=sc.nextInt();
ob.countDigit();
ob.check();
Output
PROGRAM 6
Bubble sort
Question
WAP in Java to accept a m x n matrix and sort all the elements of the array using
bubble sort technique.
Algorithm
Step 1: Start.
Code
import java.util.*;
public class bubbleSORT
{
public static void main(String args[])
{
Scanner sc = new Scanner (System.in);
System.out.println("Enter the number of rows and columns");
int m = sc.nextInt();
int n = sc.nextInt();
int arr[][] = new int [m][n];
System.out.println("Enter the elements for the array");
for ( int i = 0; i < m; i++)
{
for ( int j = 0; j < n; j++)
{
arr[i][j] = sc.nextInt();
}
}
System.out.println("The unsorted array");
for ( int i = 0; i < m; i++)
{
for ( int j = 0; j < n; j++)
{
System.out.print(arr[i][j] + " ");
}
System.out.println();
}
Variable Description
Sl.no Data Name Purpose
Type
1 int [ ] [ ] arr Accepting the array
2 int m Taking the number of rows
3 int n Taking the number of columns
4 int [ ] a Taking the elements for sorting
5 int temp Temporary variable for sorting
6 int k Index variable for second array
PROGRAM 7
Column sort
Question
WAP in Java to accept a m x n matrix and sort all the columns of the array using bubble sort
technique.
Algorithm
Step 1: Start.
Step 5: Sort the rows using the same bubble sort technique but just add another loop
outside the two loops which ensures that only the rows are trans versed and sorted.
Code
import java.util.*;
{
public static void main(String args[])
int m = sc.nextInt();
int n = sc.nextInt();
arr[i][j] = sc.nextInt();
System.out.println();
int temp = 0;
temp = arr[k][i];
}
}
System.out.println();
}
Output
PROGRAM 8
Row sort
Question
WAP in Java to accept a m x n matrix and sort all the rows of the array usingbubble sort
technique.
Algorithm
Step 1: Start.
Code
import java.util.*; public class
RowSort
{
public static void main(String args[])
{
Scanner sc = new Scanner (System.in); System.out.println("Enter the
number of rows and columns");
int m = sc.nextInt(); int n =
sc.nextInt();
int arr[][] = new int [m][n];
System.out.println("Enter the elements for the array"); for ( int i =
0; i < m; i++)
{
for ( int j = 0; j < n; j++)
{
arr[i][j] = sc.nextInt();
}
}
System.out.println("The unsorted array"); for ( int i
= 0; i < m; i++)
{
for ( int j = 0; j < n; j++)
{
System.out.print(arr[i][j] + " ");
}
System.out.println();
}
int temp = 0;
for( int i = 0; i < m; i++)
{
for ( int j = 0; j < m - 1; j++)
{
for ( int k = 0; k < m - j - 1; k++)
{
if ( arr[i][k] > arr[i][k + 1])
{
temp = arr[i][k]; arr[i][k] =
arr[i][k + 1];arr[i][k + 1] = temp;
}
}
}
}
System.out.println("The sorted array"); for ( int i
= 0; i < m; i++)
{
for ( int j = 0; j < n; j++)
{
System.out.print(arr[i][j] + " ");
}
System.out.println();
}
}
}
Output
Variable Description
Sl.no Data Name Purpose
Type
1 int [ ] [ ] arr Accepting the array
2 int m Taking the number of rows
3 int n Taking the number of columns
4 int temp Temporary variable for sorting
5 int k Extra loop variable
PROGRAM 9
Magic number
Question
Write a program to check whether a number is a magic number or not while using the following
details: -
Member Functions: -
boolean check (): will check and return true if magic else false by calling sum_of_digits(int)
function
Implement the main function, call the above methods, and print appropriately the message.
Algorithm
Step 1:start
Step 4:in the constructer the class variable n is assinged with the value the user entered
Step 7:in the sum_of_digits function the sum of the digits of the number is calculated and
returned to check function;
Step 8:now after certain calculation it will check the magic number
if sum == 1
return true;
else
return false;
if ( y == true )
else
Step 10:end
Code
import java.util.*;
int n;
Magic ( int nn )
n = nn;
int sum_of_digits(int a)
int sum = 0;
int aa = a;
while ( aa != 0 )
{
sum = sum + ( aa % 10 );
aa = aa / 10;
return sum;
boolean check()
int b = n;
int sum = 0;
sum = n;
b = sum;
sum = 0;
sum = sum_of_digits(b);
if ( sum == 1 )
return true;
else
return false;
}
}
int x;
x = sc.nextInt();
boolean y =false;
y = obj.check();
if ( y == true )
else
Output
Variable Description
Sl.no Data Name Purpose
Type
1 int nn Accepting the no entered by the user
2 int sum For storing the sum
3 boolean y Checking the no is magic or not
PROGRAM 10
Word wise
Question
Design a class WordWise to separate words from a sentence and find the
frequency of the vowels in each word. Some of the members of the class
are given below:
Class name: WordWise
Data members/instance variables:
str: to store a sentence
freq : to store the frequency of vowels
Member functions/methods:
WordWise( ) : default constructor
void readsent( ) : to accept a sentence
int freq_vowel(String w): returns the frequency of vowels in the
parameterized string w
void arrange (): displays each word of the sentence in a separate line along
with the frequency of vowels for each word by invoking the function
freq_vowel( )
Define the class WordWise giving details of the constructor (), void
readsent(), int freq_vowel(String) and void arrange (). Define the main ()
function to create an object and call the functions accordingly to enable
the task.
Algorithm
Step 1:start
Step 5:in arrange function, a extra space is added to the string first
then a for loop is runed to calculate to get the desired output but to do that freq_vowel is
called
Step 6: using the freq_vowel function the frequency of vowel in a word is calculated
if
no space is encountered then the character that is being extracted will accumulate int the
word variable
but if
Step 8:end
Code
import java.util.*;
{
String str;
WordWise()
{
str="";
}
void readsent()
{
Scanner in = new Scanner(System.in);
System.out.println("enter a string");
str=in.nextLine();
}
int freq_vowel(String w)
{
int c = 0;
for(int i=0;i<w.length();i++)
{
char ch = w.charAt(i);
char ch1 = Character.toUpperCase(ch);
if(ch1=='A' || ch1=='E' || ch1=='I' || ch1=='O' || ch1=='U')
{
c++;
}
}
return c;
}
void arrange()
{
WordWise obj = new WordWise();
for(int i=0;i<s.length();i++)
{
if(s.charAt(i)==' ')
{
int Vcount = obj.freq_vowel(word);
System.out.println(word + " " + Vcount);
word="";
}
else
word=word+s.charAt(i);
}
}
}
public static void main(String args[])
{
WordWise obj = new WordWise();
obj.readsent();
obj.arrange();
}
}
Output
Variable Description
Sl.no Data Name Purpose
Type
1 string str to store a sentence
2 int freq to store the frequency of vowels
Design a class Special to check if a given number is a special number. Some of the members of
the class are given below:
Data members:
void sum(): calculate and display the sum of the first and last digit of 'n'. void isSpecial(): check
and display if the number 'n' is a special number.
Specify the class Special giving details of the constructors, void sum and void isSpecial().
Algorithm
Algorithm for main function:
Step 1: Storing the number entered by the user in the integer type variable "n"..
Step 1: Assuming the "s" integer type variable to be 0 and declaring the "d: variable as integer
type variable.
d= n%10;
s=s+factorial(d);
n=n/10.
If true
If false
If true
Return 1;
Else
Code
import java.util.*;
if (n==0)
return 1;
else
while (n>0)
d=n%10;
s=s+factorial (d);
n=n/10;
if (s==copy)
else
void display ()
int n=sc.nextInt();
isSpecial(n);
ob.display();
}
Output
Variable Description
CONCLUSION:
After completing the project, I found out that this software has many features which are advantageousto
beginners.
It has some new features which are not seen in any other IDE.
Bluej can run run on Windows, MacOS, Linux or anyplatforms which runs java.
ACKNOWLEDGEMENT
I would like to earnestly acknowledge the sincere efforts and valuable time given by my
respected teachers - Payel maam and kaustav Sir. I would also like to express my special
thanks of gratitude to our respected Principal - Mrs. Kakoli Ghosh, who gave me the golden
opportunity to do this wonderful project, which also helped me in doing a lot of Research and I
came to know about so many new ways of implementing logic in the programs. Their valuable
guidance, innovative ideas and feedback has helped me in completing this project.
Also I would like to thank my family for their support. Without that support I couldn't have
succeeded in completing this project.
At last but not in least, I would like to thank everyone who helped and motivated me to work
on this project.