Top Banner
INDEX Chapter-1 : INTRODUCTION 1.1 Waterfall model 1.2 DFD 1.3 Title and Introduction of project 1.4 Platform used Chapter-2 : SYSTEM ANALYSIS 2.1 Preliminary Study 2.2 Requirement analysis 2.3 Proposed system 2.4 System Requirements 2 .2.1 Hardware Requirements 2.2.2 Software Requirements 2.5 Feasibility Study Chapter-3 SYSTEM DESIGN 3.1 Data flow diagram
60
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: major project Synopsis

INDEX

Chapter-1 : INTRODUCTION

1.1 Waterfall model

1.2 DFD

1.3 Title and Introduction of project

1.4 Platform used

Chapter-2 : SYSTEM ANALYSIS

2.1 Preliminary Study

2.2 Requirement analysis

2.3 Proposed system

2.4 System Requirements

2 .2.1 Hardware Requirements

2.2.2 Software Requirements

2.5 Feasibility Study

Chapter-3 SYSTEM DESIGN

3.1 Data flow diagram

Chapter-4 APPLICATION

4.1 Introduction

4.2 Programs

Page 2: major project Synopsis

CHAPTER 1

INTRODUCTION

Page 3: major project Synopsis

Software Life Cycle Model- “Waterfall Model”

The following approach is used to design this system, which is called "Classic

life cycle" or "Waterfall model". This linear sequential model suggests a

sequential, systematic approach to system development that begins at the

system level and progress through the analysis, design, coding, testing and

maintenance. The linear sequential model encompasses the following

activities:

1. System/ Information engineering and modeling.

2. System requirement analysis

3. Design

4. Code generation

5. Testing

6. Maintenance

Page 4: major project Synopsis

These above phases mark the progress of a system analysis and design

effort. It is an orderly set of activities conducted and planned for each

development project. In most business situations the activities are closely

related, usually inseparable, and even the order may be difficult to

determine.

A project is a sequence of unique, complex and connected activities having

one goal or purpose and that must be completed by specific time, within

budget, according to specification.

A project manager is an automated tool to help plan system development

activities, estimate and sassing resources, scheduled activities and

resources, monitor progress against schedule and budget, control and

modify schedule and resources, and report progress.

Analysis

Design

Code

Testing

Maintenance

System

Page 5: major project Synopsis

DATA FLOW DIAGRAMS

Data flow diagram (DFD) is used to show how data flows through the

system and the processes that transform the input data into output. Data

flow diagrams are a way of expressing system requirements in a

graphical manner. DFD represents one of the most ingenious tools used

for structured analysis. It is also known as a bubble chart.

In the normal convention, logical DFD can be completed using only

four notations.

: Represents source or destination of data

: Represents data flow

: Represents a process that transforms

incoming data into outgoing data

: Represents data source

Page 6: major project Synopsis

The DFD at the simplest level is referred to as the ‘CONTEXT ANALYSIS DIAGRAM’. These are expanded by level, each explaining its process in detail. Processes are numbered for easy identification and are normally labeled in block letters. Each data flow is labeled for easy understanding.

LEVELS OF DFD:

The complexity of the business system means that it is a responsible to

represent the operations of any system of single data flow diagram. At the

top level, an Overview of the different systems in an organization is shown

by the way of context analysis diagram. When exploded into DFD

They are represented by:

LEVEL-0: SYSTEM INPUT/OUTPUT

LEVEL-1 : SUBSYSTEM LEVEL DATAFLOW FUNCTIONAL

LEVEL-2 : FILE LEVEL DETAIL DATA FLOW.

The input and output data shown should be consistent from one level to the

next.

LEVEL-0: SYSTEM INPUT/OUTPUT LEVEL

A level-0 DFD describes the system-wide boundaries, dealing inputs to and

outputs from the system and major processes. This diagram is similar to the

combined user-level context diagram.

LEVEL-1: SUBSYSTEM LEVEL DATA FLOW

A level-1 DFD describes the next level of details within the system, detailing

the data flows between subsystems, which makeup the whole.

LEVEL-2: FILE LEVEL DETAIL DATA FLOW

All the projects are feasible given unlimited resources and infinite time. It is

both necessary and prudent to evaluate the feasibility of the project at the

Page 7: major project Synopsis

earliest possible time. Feasibility and the risk analysis are pertained in many

ways. If project risk is great.

VIRTUAL NETWORK COMPUTING

Virtual Network Computing (VNC) is a graphical desktop sharing system to remotely control another computer. It transmits the keyboard and mouse events from one computer to another, relaying the graphical screen updates back in the other direction, over a network.

There are times, as a window network, you would like to control certain aspects of machine seating remotely, without having to install and trigger an application on the remote machine that ill communicate with the clients machine.

Out software provides architecture in which there is one client to control the remote machine. There is one Sever application (Remote machine).

This Server application will receive all requests from the client application and send periodically screen and updates to client when requested.

When Client application connects to remote machine, it will receive the connection request and sends signals to Remote machine.

Controlling the remote machine includes :-

Capturing Desktop.

Mouse Handling.

Keyboard Handling.

Page 8: major project Synopsis

Java Programming Language

The java programming language is a high level language that can

be characterized by all of the following buzzwords.

Simple Architecture-neutral Object Oriented Portable Distributed High-performance Interpreted Multithreaded Dynamic Secure

With most programming languages, you either compile or interpret

program so that you can run it on your computer. The java programming

language is unusual in that a program can be both compiled and interpreted.

With the compiler, first you translate a program into an intermediate

language called Java Byte Code. The interpreter on the java platform

interprets these platform independent codes. The interpreter parses and runs

each Java byte code instruction on the computer. Compilation happens just

once; interpretation occurs each time the program is executed.

You can think of java as the machine code instructions for the Java Virtual

Machine (Java VM). Every java interpreter, whether it is a

development tool or a Web browser that can run applets, is an

implementation of the Java VM.

Page 9: major project Synopsis

History of Java

Java development began at Sun Microsystems in 1991, the same year the

World Wide Web was conceived. Java’s creator, James Gosling did not design

java for the Internet. His Objective was to create a common development

environment for consumer electronic devices which was easily portable from

one device to another. This effort evolved into a language, code named Oak

and later renamed Java that retains much of the syntax and power of c++,

but is simpler and more platform-independent.

The Java Platform

A platform is the hardware or software environment in which a program

runs. We have already mentioned some of the most common platforms

like Windows 2000, Linux, Solaris and MacOS. Most platforms can be

described as the combination of the operating system and hardware. The

java platform differs from most of the other platforms in that it is software-

only platform that runs on top of other hardware-based platforms.

The java platform has two components:

1.The Java Virtual Machine

2.The Java Application Programming Interface (Java API)

Page 10: major project Synopsis

Java VM is the base for the Java platform and is ported onto various hardware-

based platforms.The Java API is large collection of ready-made software

components

that provide many useful capabilities, such as graphical user interface (GUI)

widgets.

The Java API is grouped into libraries of related classes and interfaces; these

libraries are known as packages. The java API and the virtual machine insulate

the

program from the hardware.

Native code is the code that after you compile it, the compiled code runs on a

specific hardware platform. As a platform-independent environment, the java

platform

can be a bit slower than native code. However, smart compilers, well-tuned

interpreters,

and just-in-time byte code compilers can bring performance close to that of

native

code without threatening portability.

Page 11: major project Synopsis

TECHNOLOGY SPECIFICATIONS

IP Address and SOCKETS an overview

An Internet Protocol address (IP address) is a numerical label assigned

to each device (e.g. computer, printer) participating in a computer network

that uses the Internet Protocol for communication. An IP address serves two

principal functions: host or network interface identification and location

addressing. Its role has been characterized as follows: "A name indicates

what we seek. An address indicates where it is. A route indicates how to get

there .

In computer networking, a port is an application-specific or process-

specific software construct serving as a communications endpoint. It is used

by Transport Layer protocols of the Internet Protocol Suite, such as

Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). A

specific port is identified by its number, commonly known as the port

number, the IP address with which it is associated, and the protocol used for

communication.

A socket is an endpoint used by a process for bi-directional

communication with a socket associated with another process. Sockets

provide a session layer protocol. Sockets can be connection oriented or

connectionless. Sockets, introduced in Berkeley Unix, are a basic mechanism

for IPC on a computer system, or on different computer systems connected

by local or wide area networks. On any given platform, there are likely to be

other forms of IPC that are faster, but for cross-platform communication,

sockets are about the only game in town. They spread like wildfire with the

Internet.

In order for a client & server to communicate

Page 12: major project Synopsis

Client & server must each create sockets

Client must know the address of the server (but not vice versa)

Client must establish a connection and identify self to server

Then can communicate via the socket

For communicating using Sockets

Client must:

1. Create a socket using the socket () system call

2. Connect the socket to the address of the server using connect ()

3. Send and receive data using read () and write ()

Server must:

1. Create a socket using the socket () system call

2. Bind the socket to an address (host name + port) using bind ()

3. Listen for connections using listen ()

4. Accept a connection using accepts ()

5. Send and receive data using read () and write ()

Page 13: major project Synopsis

GUI using Swings

Graphical user interface make the usage of the package simpler and

smoother. So here we had used Java Swing to create the GUI. Swing is a part

of Java Foundation Class. Swing is a set of classes that provides more

powerful and flexible component for the GUI. In addition to the familiar

components like buttons, checkboxes, and labels, swing supplies several

exciting additions including tabbed panes, scroll panes, tree and tables.

Swing components can provide a pluggable look and feel, which means that

it is easy to substitute another appearance and behavior for the component.

You may even design your own look and feel. Swings are not implemented

by platform specific code. Instead they are written entirely in Java; therefore

they are platform independent.

Page 14: major project Synopsis

CHAPTER 2

SYSTEM ANALYSIS

SYSTEM ANALYSIS

System Analysis works with users to identify goals and build systems to achieve

them. System analysis is an important phase of any system development

process.

The system is studied to the minutest details and analyzed. The system analyst

plays

the role of an interrogator and dwells deep in to the working of the present

system.

Page 15: major project Synopsis

In analysis, a detailed study of these operations performed by a system and

their

relationships within and outside of the system is done. A key question

considered here

is, “what must be done to solve the problem?” One aspect of analysis is defining

the boundaries of the system and determining whether or not the candidate

system

should be considered.

The system is viewed as a whole and the inputs to the system are identified.

The outputs from the system are traced through the various processing that the

input phase through in the organization. During analysis, data are collected on

available files, decision points, and transaction handled by present system. Once

analysis

is completed the analyst has a firm understanding of what is to be done.

Based on analysis a cost/benefit analysis is considered. Here the cost for the

system

is calculated on the basis of the analysis made.

The solutions are given as a proposal. The proposal is presented to the user for

an endorsement by the user. The proposal is reviewed on user requestand

suitable

changes are made. This is a loop that ends as soon as the user is

satisfied with the proposal.After all these proposal becomes a formal agreement

that

paves way for design and implementation.

Page 16: major project Synopsis

PRELIMINARY STUDY

Preliminary study is the process of gathering and interpreting facts, using the

information for further studies on the system. It is a problem solving activity that

requires intensive communication between the system users and system

developers.

It does various feasibility studies. In these studies, a rough figure of the system

activities can be obtained, from which the decisions about the strategies to be

followed for effective system study and analysis can be taken. Preliminary study

also identifies the method collection to be followed.

At the preliminary study conducted an initial picture about the system working

was got. From the information got form the study, the data collection methods

are identified. Even in the first investigation itself drawback of the existing

system

could be identified.

Page 17: major project Synopsis

REQUIREMENT ANALYSIS

Upon evaluating current problems and desired information (input and

output), the analyst begins to synthesize one or more solution. To begin, the

data objects, processing function, and behavior of the system are defined in

detail. Once this information has been established basic architecture of

implementation are considered. A client –server approach would seem to be

appropriate but does the software support this architecture fall within the

scope outlined in the software plan? A database management system would

seem to be required, but is the user/customers need for associating justified?

The process of evaluation and synthesis continues until both analyst and

customer feel confident that software can be adequately specified for

subsequent development steps.

Throughout evaluation and solution, synthesis, the analyst’s primary focus is

on “What” , not “How”. What data does the system produce and consume,

What function must the system perform, What behaviors does the system

exhibits, What interface are defined and What constraint apply?

During the evaluation and solution synthesis actually the analyst creates

model of the system in and effort to better understand data and control flow

of functional processing operational behaviors and information contained.

The model servers as a foundation for software design and the basic for the

creation of specifications for the software.

Keeping in mind the problem with requirement gathering, a number of

independent investigators have developed a team oriented approach to

requirement gathering that applied during early stages of analysis and

Page 18: major project Synopsis

specifications called FACILITATED APPLICATION SPECIFICATION TECHNIQUES

(FAST).

This approach encourages the creation of a join team of customers and

developers who work together identify the problem, propose elements of the

solution, negotiate different approach and specify preliminary set of solution

requirements has been used predominantly by the information system

community, but the technique offers potential for improved communication

in application of all kinds.

Many different approaches of FAST have been proposed. Each makes use of

a slightly different scenario but all apply variation on the following basic

guide lines.

A meeting is conducted at a neutral site and attended by both

software engineers and customers.

Rule for preparation and participation are established.

An agenda is suggested that is formal enough to cover all important

points but informal enough to encourage the free flow of ideas.

A “facilitator” (can be a customer, a developer, or an outsider)

control the meeting.

A “definition mechanism” (can be work sheets, flip charts, or wall

stickers or an electronic bulletin board, chat room or virtual form) is

used.

The goal is to identify the problem, propose elements of the

solutions, negotiate different approaches, and specify a preliminary

set of solution requirements and atmosphere i.e. conductive to the

accomplishment of the goal.

Page 19: major project Synopsis

Initial meetings between the developers and customers occur and basic

question and answer help to establish the scope of the problem and the

overall perception of a solution. Out of these initial meeting, the developer

and customers write a one-or two-page “Product request”. A meeting place,

time and date for FAST arte selected and a facilitator is chosen attendees

form both the development and customer/User organization are invited to

attend. The product request is distributed to all attendees before the

meeting date.

Quality Function Deployment: Quality function deployment is a quality

management technique that translates the needs of the customer in to

technical requirement for software. To accomplish this QFD emphasizes

understanding of what is valuable to the customer and deploys these values

throughout the engineering process. QFD identify three types of

requirements. –

1. Normal Requirements.

2. Expected Requirements.

3. Exciting Requirements.

Page 20: major project Synopsis

PROPOSED SYSYTEM

The proposed system is supposed access the desktop of the remote machine

(Server) to the machine on which it is running (Client).

This system is supposed to have two machines, one as server and the other

as client. The Server will start and wait for a client to establish a connection.

Client requires server machine’s IP address to connect.

When a client connects to the server a connection is establish for that

particular client. Then server sends image of the desktop of the server

machine.

These images are sent after every specific time interval and update the

client about the server’s desktop status.

Page 21: major project Synopsis
Page 22: major project Synopsis

SYSTEM REQUIREMENTS

Hardware Requirements:

Configuration: Two PC (or PCXT, PXAT and onwards), belonging to same

network connection

Memory: 16 MB RAM

Hard Disk: Above 1 GB

Mouse: Standard Serial Mouse

Keyboard: 101/104 Keys

Software Requirements:

Operating System: Windows XP and above

Software: JVM (JDK 1.4.1 or more).

Page 23: major project Synopsis

FEASIBILITY STUDY

From the inception of ideas for a software system, until it is implemented

and delivered to customer and even after that the system undergoes gradual

developments and evaluations.

The software is said to have life cycle composed of several phases.

At the feasibility stage, it is desirable that two or three different configuration

will be pursed that satisfy the key technical requirement but which represent

different level of ambition and cost.

Feasibility is the determination of whether or not a project is worth doing. A

feasibility study is carried out select a best system that mate performance

requirements.

The data collected during primary investigation examines system feasibilities

that are likelihood that the system will be beneficial to the organization. Four

tests for feasibility study are as follows: -

1. Technical Feasibility:

This is concerned with specifying equipment and software that will successfully satisfy the use considerably, but might include:

The feasibility to produce output in a given time because system

is fast enough to handle multiple users.

Response time under certain circumstances and ability to

process a certain volume of transaction of a particular speed.

Feasibility to communicate data to distant location.

Page 24: major project Synopsis

2. Economical Feasibility:

Economic analysis is the most frequently used technique used for

evaluating the effectiveness of a proposed system. More commonly

known as cost/benefit analysis the procedure is to determine the

benefits and savings that are expected from a proposed system and

compared them with cost. Though the cost of installing the system

may appear high, it is one time investment. The resulting benefit is

that automation results in turn around time. The resulting cost/benefit

ratio is favorable.

3. Operational Feasibility:

It is mainly related to human organizational as social aspects. The

points to be considered are:

The system interface is standard

It is user friendly

Provides extensive help. Hence, no training is required.

Page 25: major project Synopsis

CHAPTER 3

SYSTEM DESIGN

Page 26: major project Synopsis
Page 27: major project Synopsis

1 st level DFD of VIRTUAL NETWORK COMPUTING

Establish Connection

Capture Desktop

Operate Remote Desktop

CLIENT SERVER

Page 28: major project Synopsis

2 nd level DFD of Establish Connection Process

REQUEST,IP ADDRESS CONNECTION

2 nd level DFD of Capture Desktop process

CONNECTION IMAGE EVENTS

2 nd level DFD of Operate Remote Desktop Process

IMAGE EVENTS USES

Establish Connection

Process CLIENT

Capture

Desktop Process

Operate Remote Desktop Process

SERVER

Page 29: major project Synopsis

CHAPTER 4

APPLICATIONS

Page 30: major project Synopsis

INRODUCTION

Project Virtual network computing(VNC) will be developed in java. Concept of java

that mainly be used in this project will be :-

1.Networking

2.MouseEvent handling

3.KeyEvent handling

4.MultiThreading

5.File Handling

Some applications showing the implementation of all above concepts is developed .

This will help to develop a project.

Page 31: major project Synopsis

PROGRAM TO IMPLEMENT NETWORKING IN JAVA

SERVER CODE:

import java.io.*;import java.net.*;import java.util.*;

public class MyServer{ ArrayList al =new ArrayList(); ServerSocket ss; Socket s;

public MyServer() {

try { ss= new ServerSocket(10); while(true) {

s=ss.accept();al.add(s);Runnable r=new MyThread(s,al);Thread t=new Thread(r);t.start();

} }catch(Exception e){}

}

public static void main(String ar[]) {

new MyServer(); }}

Page 32: major project Synopsis

class MyThread implements Runnable{

Socket s;ArrayList al;MyThread(Socket s,ArrayList al) {

this.s=s;this.al=al;

}

public void run(){

String s1;try{DataInputStream din = new DataInputStream(s.getInputStream());do

{s1=din.readUTF();System.out.println(s1);if(!s1.equals("stop"))tellEveryOne(s1);else

{DataOutputStream dout = new

DataOutputStream(s.getOutputStream());dout.writeUTF(s1);dout.flush();

}}while(!s1.equals("stop"));}catch(Exception e1){}

}

Page 33: major project Synopsis

public void tellEveryOne(String s1) {

Iterator i=al.iterator();while(i.hasNext()){ try

{ Socket sc=(Socket)i.next(); DataOutputStream dout=new DataOutputStream(sc.getOutputStream());

dout.writeUTF(s1); dout.flush();

}catch(Exception e){}}

}}

Page 34: major project Synopsis

CLIENT CODE

import java.io.*;import java.net.*;

public class MyClient1{

Socket s;DataInputStream din;DataOutputStream dout;public MyClient1(){

try{ s=new Socket("LocalHost",10);

din =new DataInputStream(s.getInputStream()); dout=new DataOutputStream(s.getOutputStream()); clientChat();

}catch(Exception e){

System.out.println(e);}

}

public void clientChat() throws IOException {

My m=new My(din); Thread t1=new Thread(m); t1.start(); BufferedReader br=new BufferedReader( new InputStreamReader (System.in)); String s1; do { s1=br.readLine();

Page 35: major project Synopsis

dout.writeUTF(s1); dout.flush(); } while(!s1.equals("stop")); }

public static void main(String args[]){

new MyClient1();}

}

class My implements Runnable { DataInputStream din; My(DataInputStream din) {

this.din=din; } public void run() { String s2=" "; do {

try {

s2=din.readUTF();System.out.println(s2);

} catch(Exception e)

{}

}while(!s2.equals("stop")); } }

Page 36: major project Synopsis

OUTPUT:

SERVER

Client1

Client 2

Page 37: major project Synopsis

Program for MouseEvent Handler

Page 38: major project Synopsis

import java.awt.*;import java.applet.*;import java.awt.event.*;/*<applet code="MouseDemo" width=300 height=100></applet>*/public class MouseDemo extends Applet implements MouseListener,MouseMotionListener{

int mx=0;int my=0;String msg="";public void init(){

addMouseListener(this);addMouseMotionListener(this);

}public void mouseClicked(MouseEvent me){ mx=20;

my=40;msg="Mouse Clicked";repaint();

}public void mousePressed(MouseEvent me){

mx=30;my=60;msg="Mouse Pressed";repaint();

}public void mouseReleased(MouseEvent me){

mx=30;my=60;msg="Mouse Released";repaint();

}

Page 39: major project Synopsis

public void mouseEntered(MouseEvent me){

mx=40;my=80;msg="Mouse Entered";repaint();

}public void mouseExited(MouseEvent me){

mx=40;my=80;msg="Mouse Exited";repaint();

}public void mouseDragged(MouseEvent me){

mx=me.getX();my=me.getY();showStatus("Currently mouse dragged"+mx+" "+my);repaint();

}public void mouseMoved(MouseEvent me){

mx=me.getX();my=me.getY();showStatus("Currently mouse is at"+mx+" "+my);repaint();

}public void paint(Graphics g){

g.drawString("Handling Mouse Events",30,20);g.drawString(msg,60,40);

}}

OUTPUT:

Page 40: major project Synopsis

Program for KeyEvent Handler.

import java.awt.*;

Page 41: major project Synopsis

import java.applet.*;import java.awt.event.*;/*<applet code="KeyDemo" width=300 height=300></applet>*/public class KeyDemo extends Applet implements KeyListener{ String msg="";

int x=10;int y=20;public void init(){

addKeyListener(this);requestFocus();

}public void keyPressed(KeyEvent ke){

showStatus("key pressed");int key=ke.getKeyCode();switch(key){

case KeyEvent.VK_SPACE:msg=msg + "<SPACE IS PRESSED >";

break;case KeyEvent.VK_SHIFT:msg=msg + "<SHIFT IS PRESSED

>"; break;

case KeyEvent.VK_NUMPAD4:msg=msg + "<4 IS PRESSED >";

break;}repaint();

}public void keyReleased(KeyEvent ke){

showStatus("Key Released");}

public void keyTyped(KeyEvent ke){

char ch=ke.getKeyChar();msg=msg+ch;

Page 42: major project Synopsis

showStatus("Key Typed");}public void paint(Graphics g){

g.drawString(msg,40,40);}

}

OUTPUT:

Page 43: major project Synopsis

Program to implement multithreading

import java.io.*;

Page 44: major project Synopsis

import java.lang.*;import java.awt.*;import java.awt.event.*;

class test extends Frame implements ActionListener,Runnable{

int lower,upper;Label l1=new Label("ODD");Label l2=new Label("EVEN");List lb1=new List();List lb2=new List();Button b2=new Button("EXIT");test(int low,int up){

lower = low;upper = up;setLayout(new FlowLayout());setSize(700,700);setTitle("Thread Demo");setVisible(true);add(l1);add(lb1);add(l2);add(lb2);add(b2);b2.addActionListener(this);Thread t=new Thread(this);t.start();

addWindowListener(new WindowAdapter(){

public void windowClosing(WindowEvent e) { System.exit(0); }}

);

Page 45: major project Synopsis

}

public void actionPerformed(ActionEvent ae){

if(ae.getSource()==b2)System.exit(0);

}public void run(){

try{

if((lower % 2) != 0){

lower = lower + 1;}while(lower <= upper){

Thread.sleep(1000);lb2.add(String.valueOf(lower));lower += 2;Thread.sleep(500);

}}catch(Exception e){}

}

public static void main(String args[]){

int lower,upper;lower = Integer.parseInt(args[0]);upper = Integer.parseInt(args[1]);test ob = new test(lower,upper);if((lower % 2) == 0)

Page 46: major project Synopsis

{lower = lower + 1;

}try{

while(lower <= upper){

Thread.sleep(1000);ob.lb1.add(String.valueOf(lower));lower = lower + 2;Thread.sleep(500);

}}catch(Exception e){}

}}

OUTPUT:

Page 47: major project Synopsis

PROGRAM TO SHOW FILE HANDLING

import java.lang.*;

Page 48: major project Synopsis

import java.io.*;import java.util.*;class WordCount{ public static void main(String arg[]) throws Exception { int char_count=0; int word_count=0; int line_count=0; String s; StringTokenizer st; BufferedReader buf=new BufferedReader(new InputStreamReader(System.in)); System.out.print("Enter filename : "); s=buf.readLine(); buf=new BufferedReader(new FileReader(s)); while((s=buf.readLine())!=null)

{line_count++;st=new StringTokenizer(s," ,;:.");while(st.hasMoreTokens()){

word_count++;s=st.nextToken();char_count+=s.length();

}}System.out.println("Character Count : "+char_count);System.out.println("Word Count : "+word_count);System.out.println("Line Count : "+line_count);buf.close();

}}

OUTPUT:

Page 49: major project Synopsis