Chapter 1

INTRODUCTION
--------------------------------------------------------------------------------A command prompt is used in a text-based or "command-line" interface, such as a
UNIX terminal or a DOS shell. It is a symbol or series of characters at the beginning of a
line that indicates the system is ready to receive input. It other words, it prompts the user
for a command (hence the name).
Since a command prompt requires specific input, it is basically useless if you
don't know the syntax of the command you want to enter. Therefore, knowledge of some
basic commands is required to use a command-line interface. Fortunately, most operating
systems now use a graphical user interface GUI as their main way of requesting input
from the user. This means you don't have to learn any special commands in order to use
the computer. However, learning to use a command-line interface is kind of like learning
to drive a car with a manual transmission. You never know when it might come in handy.

1.1 What is a command prompt or Terminal?
A command prompt is a non-graphical interface that allows you to interact with
your operating system. At the command prompt, you enter commands by typing their
names followed by options and arguments. Most modern computers use a graphical user
interface (GUI), which allows users to more intuitively access programs and documents.
However, some programs and commands are still only available only through a command
prompt. To access the command prompt, follow the instructions appropriate to your
operating system.
A user can type commands at the command prompt, such as cd /, which means
"change directory to the root folder." The "cd" command allows the user to browse
through different directories of files on a hard disk or network. There are dozens of other
commands that a user can type, which can be used to list, move, delete, and copy files,
run programs, or perform other operations. While the "cd" command is the same in both
DOS and UNIX, many other commands have different syntax.

1.2 Windows Command Prompt :1

. In UNIX. in Windows 7. your main interface to the system is called the UNIX SHELL. This is the program that presents you with the dollar sign ($) prompt. 2 . which indicates the user is working at the root level of the main C: drive.. They all use the dollar sign as their prompt. one of the most standard UNIX shells called the Bourne Shell. 1. Command Prompt is most commonly used to execute batch files.exe. and then enter cmd. When they logon to the system.3 Unix terminal :When you log into a UNIX computer. These switches are one of the most powerful features of UNIX commands. The tilde (~) indicates the current directory is the user's home folder. We will look at several of the most common commands below. Command Prompt is sometimes incorrectly referred to as "the DOS prompt" or as MS-DOS itself. the prompt may be ~ user$. When you log onto a UNIX system. Command Prompt is officially called Windows Command Processor but is also sometimes called the command shell or by its file name cmd. click the Start button and enter cmd. and troubleshoot and solve certain kinds of Windows issues. For example. the default prompt in DOS may be C:\. you just type it in at the keyboard and press the ENTER key.To access the command prompt in Windows. which is a portion of the disk space reserved just for them. from the Start menu. select Run. Other shells such as the Korn Shell or Bourne Again Shell work very similarly at this level. UNIX commands are strings of characters typed in at the keyboard. your shell begins to run and provides you with a command prompt. where "user" is the name of the current user. The command prompt is often preceded by the current directory of the system the user is working with. Switches are usually preceded with a dash (-) and precede any filenames or other arguments on the command line. There is more than one variety of shell that can be used on a UNIX system. To run a command. This prompt means that the shell is ready to accept your typed commands. they are placed in a HOME directory. Every user has a unique username. Command Prompt is a Windows program that emulates many of the command line abilities available in MS-DOS but it is not actually MS-DOS. The command prompt's appearance varies depending on the shell you're using. UNIX extends the power of commands by using special flags or switches. In other versions. perform advanced administrative functions.

machine has to be a Java Virtual Machine (JVM). It is platform independent. command for same task is clear. command for same task is cp. the command for removing a file Del while in Unix.6. new application is created called ‘Multi-Platform based Virtual terminal. the commands used are common for all platforms such as windows. windows has their own commands. So. Nearly all command names and most of their command line switches will be in lowercase.1 Features of Virtual Terminal :3 . 1.  In windows. command for same task is ls.  In windows. Their comparison is as follows:  In windows. etc.1.  In windows. It recovers disadvantages of terminal. It is written in Java.’ In this terminal.4 Comparison between Windows and UNIX commands :There are many commands which are use for same task but have different syntax in different operating systems. Same command can be execute on all platform. In this we create user define commands. 1. Therefore.  In windows. command for same task is mv. It also has a built in editor which lets you write files. command for same task is rm. Unix. UNIX systems are case sensitive (upper and lower case characters are considered different). java must be installed in system i. To resolve this difficulty. the new user fined it difficult to work on these command prompt or terminal. the command for listing files directory is dir while in Unix. 1. the command for copying a file is Copy while in Unix. as all operating system such as Unix.  Windows or DOS commands are not case sensitive.5 Difficulty :The main difficulty is.6 Multi-platform based Virtual Terminal :This terminal works as the virtual command prompt on multiple platforms. the command for moving a file Move while in Unix. the command for clearing the screen is cls while in Unix.e.

It’s just like as of "doskey" in DOS.1.class file is in your drive C:\. It supports "command-line surfing". It cannot access any other partition or drive directly from the command-line. You can easily switch between your previous commands using the UP arrow & DOWN arrow keys. then only C drive can be accessed. all these entries are then processed sequentially. If the Terminal. 3. "hello.txt" where. "example" is the name of the file you have written. "write" & "mplayer" simultaneously. It supports multiple entries of filenames & website names under a single command. 2.g. c) Type "save example" where. "run calc write mplayer" will start the programs "calc". b) Write whatever you want to write. It can run any number of programs with a single 'command-line' command e. 6. Chapter2 SOFTWARE ENGINEERING PARADIGM 4 . It also has a built in editor which lets you write files: a) Type "edit" at the command-line.). 5. then delete the directory. 7. d) Type "exit" at command-line to exit from the editor mode and go back to command mode of “Virtual Terminal" e) To edit an existing file type "edit hello. It supports multiple video modes (like orange text on black background etc. 4.txt" is the existing file you want to edit. A directory cannot delete with files inside it. the files inside have to be deleted.

1 Requirements Phase :In this phase. The software model followed for implementing this project is waterfall model. Various methodology models such as waterfall. We will try to understand the specific requirements that must be achieved to implement this project. prototyping. all the requirements of the project will be gathered based on which the problem will be analyzed. Fig 2. At the end of this phase.1 Phases of Project :This section explains the various phases of the project. incremental. The model suitable for our project is waterfall model. spiral etc. we will have 5 .1. 2.1 Waterfall Model This project consists of following phases:* Requirements * Analysis * Design * Implementation * Testing 2.-----------------------------------------------------------------------------------------------------------Every project has its own methodology.

2. a graphical model.1.1. software engineering. a formal mathematical model. 2. The System specification is the final work product produced by the system and requirements engineer.0 or above.1. 1) JDK 1. It serves as the foundation for the hardware engineering. Pentium III 700 MHz (2) 2.1 Requirement specification :In the context of computer-based systems (and software). and a collection of usage of scenarios.6. 2 GB Hard Disk space.1. 1. 2.1. Any faster machine would certainly improve the performance and speed. It describes the function and performance of a computer-based system and the constrained that will govern its development.1. The specification also describes the information that is input to and output from the system.detailed understanding of the nature of application to be developed by identifying the problem and specify refined preliminary set of proposed solution. This phase will state following points in detail * Problem definition * Need for building this application * Requirement Specification * Scope of the Project. the term specification means different things to different people.1. giving satisfactory results. any upgraded versions of the software will also works. prototype or any combination of these. database engineering and human engineering.2 Hardware requirements :These are the minimum requirements of the computer setup for the product developed to run. 2.2 Analysis Phase :6 . * Deliverables of the Project. 64 MB Ram 3. a specification can be written document.3 Software requirements :These are the requirement for the well functioning of the software.

These rules are known as its “syntax”. Validation Testing and system Testing will be carried out for various test cases. various testing strategies like Unit Testing. The database designing will be done keeping in view the performance issues. The Chapter describes about the software tool that is used in our project. The functionality of each unit will be tested during this phase.4 Testing :In this phase. we will implement the project using the technologies decided in analysis phase. 2. the high-level instructions are translated into numeric codes that computers can understand and execute. Once a program has been written. debug.5. the architecture of the project will be designed and designed and decisions regarding problem evaluation will be taken. we will come out with various UML diagrams. 2. Java has a set of rules that determine how the instructions are written. 2. The technology decision for implementing the project is taken in this phase.5 Technology Used :.2 Why Choose Java? Java was designed with a few key principles in mind: 7 .3 Implementation :In this phase. Integration Testing. The basic modules in which the project will be divided will be taken. In this phase. It’s known as a “high-level” language because it can be read and written easily by humans. which explain the design of the project. All the modules will be tested for specific test and all the errors uncovered will be fixed. The modules will be implemented as per the design.This phase analyzes the various aspects of the project. 2. Based on the decided strategy.2 Design :In this phase. All the data structures and interfaces required would be designed as per the specifications mentioned in Requirements phase. maintain. instead of having to write in numeric codes. 2. or otherwise support other programs and applications. It enables programmers to write computer instructions using English based commands.1 What Is Java? Java is a computer programming language. Like English. The term usually refers to relatively simple programs that can be combined together to accomplish a task. 2. we will decide the coding strategy that will be employed to implements this Project.5.JAVA A programming tool or software tool is a program or application that software developers use to create.

Java built on. A Windows program will not run on a computer that only runs DOS. and inadequate for all of Java's requirements. to provide a programming language that was powerful and simple to use. it was built to include a high level of security. Easy to Use: The fundamentals of Java came from a programming language called c++.5. Once data and its manipulation were packaged together in one place. With this in mind. A platform is a loosely defined computer industry buzzword that typically means some combination of hardware and system software that will mostly run all the same software. and Java's popularity can be traced to it being a robust. and improved the ideas of c++. it was felt to be too complex in its syntax.  Reliability: Java needed to reduce the likelihood of fatal errors from programmer mistakes. secure. it increased Java’s robustness. Computer programs are very closely tied to the specific hardware and operating system they run. A Mac application can't run on a Unix workstation. For instance PowerMacs running Mac OS 9.3 Java is a Platform :Java (with a capital J) is a platform for application development. Java was written to be a portable language that doesn't care about the operating system or the hardware of the computer. easy to use.  Secure: As Java was originally targeting mobile devices that would be exchanging data over networks. object-oriented programming was introduced. Java solves the problem of platformindependence by using byte code. There's another problem with distributing executable programs from web pages. 2. Instead it produces a special 8 . The team at Sun Microsystems was successful in combining these key principles. Java is probably the most secure programming language to date. The Java compiler does not produce native executable code for a particular machine like a C compiler would.2 would be one platform. DEC Alphas running Windows NT would be another. and portable language.  Platform Independent: Programs needed to work regardless of the machine they were being executed on. Although c++ is a powerful language.

but also in compiled binary form. The most important part of helping programmers write bug-free code is keeping the language simple. The 9 . but unlike machine language Java byte code is exactly the same on every platform. According to Sun's Bill Joy. Since the byte code is completely platform independent. 2. Thus to port Java programs to a new platform all that is needed is to port the interpreter and some of the library routines. the javac compiler. and more are collectively referred to as Java. Java programs that have been compiled into byte code still need an interpreter to execute them on any given platform.5. About half of the bugs in C and C++ programs are related to memory allocation and deallocation. Rather a special native program called the Java interpreter reads the byte code and executes the corresponding native machine instructions. it is easy to read and write. 2. on average. Java has the bare bones functionality needed to implement its rich feature set. looks like this: CA FE BA BE 00 03 00 2D 00 3E 08 00 3B 08 00 01 08 00 20 08 This looks a lot like machine language. The rest of the runtime environment including the compiler and most of the class libraries are written in Java.5. Despite its simplicity Java has considerably more functionality than C. one bug per 55 lines of code. the java interpreter.5 Java is Platform Independent :Java was designed to not only be cross-platform in source form like C. the Java programming language.format called byte code. Java byte code written in hexadecimal. Because Java is simple. The interpreter reads the byte code and translates it into the native language of the host machine on the fly. All these pieces. The most common such interpreter is Sun's program java (with a little j). only the interpreter and a few native libraries need to be ported to get Java to run on a new computer or operating system. It does not add lots of syntactic sugar or unnecessary features. Even the compiler is written in Java. This byte code fragment means the same thing on a Solaris workstation as it does on a Macintosh PowerBook. There aren't a lot of special cases or tricks that will confuse beginners. Obfuscated Java isn't nearly as common as obfuscated C. primarily because of the large class library.4 Java is Simple :Java was designed to make it much easier to write bug free code. byte by byte. shipping C code has. A Java program never really executes natively on the host machine. Since this is frankly impossible across processor architectures Java is compiled to an intermediate form called byte-code.

each Java virtual machine has a class loader subsystem: a mechanism for loading types given fully qualified names. Three Java applets on the same page can run together with each getting equal time from the CPU with very little extra effort on the part of the programmer. It is more to provide a way to strictly define the external behavior of implementations. that it makes Java rather difficult to port to architectures like Windows 3.5. These components describe an abstract inner architecture for the abstract Java virtual machine. and intermediate results of computations. memory areas. As mentioned in previous chapters.6 The Architecture of the Java Virtual Machine :In the Java virtual machine specification. parameters to methods. data types.1 or the PowerMac that don't natively support preemptive multi-threading. Integers are always four bytes long. 10 .2 shows a block diagram of the Java virtual machine that includes the major subsystems and memory areas described in the specification. and floating point variables follow the IEEE 754 standard for computer arithmetic exactly.byte codes are precisely defined. the behavior of a virtual machine instance is described in terms of subsystems. local variables. Unfortunately multithreading is so tightly integrated with Java. Each Java virtual machine also has an execution engine: a mechanism responsible for executing the instructions contained in the methods of loaded classes. This makes Java very responsive to user input. Figure 2. The second important part of making Java cross-platform is the elimination of undefined or architecture dependent constructs.6 Java is Multi-Threaded :Java is inherently multi-threaded. it needs memory to store many things. The specification defines the required behavior of any Java virtual machine implementation in terms of these abstract components and their interactions. and remain the same on all platforms. 2. When a Java virtual machine runs a program. return values. and instructions. including byte codes and other information it extracts from loaded class files. The purpose of these components is not so much to dictate an inner architecture for implementations. It also helps to contribute to Java's robustness and provides a mechanism whereby the Java environment can ensure that a malicious applet doesn't steal all of the host's CPU cycles. A single Java program can have many different threads executing independently and continuously. 2. objects the program instantiates.

Some implementations may have a lot of memory in which to work. Different implementations of the virtual machine can have very different memory constraints. their specification is quite abstract. Many decisions about the structural details of the runtime data areas are left to the designers of individual implementations. others may not. As the program runs. it parses information about a type from the binary data contained in the class file. When the virtual machine loads a class file. others may have very little. The internal architecture of the Java virtual machine. These areas are shared by all threads running inside the virtual machine.Fig. 11 . Some runtime data areas are shared among all of an application's threads and others are unique to individual threads. Some implementations may be able to take advantage of virtual memory. the virtual machine places all objects the program instantiates onto the heap. It places this type information into the method area.2. Each instance of the Java virtual machine has one method area and one heap. The Java virtual machine organizes the memory it needs to execute a program into several runtime data areas. Although the same runtime data areas exist in some form in every Java virtual machine implementation. 2.

other factors also played an important role in molding the final form of the language. Somewhat surprisingly. The trouble with C and C++ (and most other languages) is that they are designed to be compiled for a specific target.1. Ed Frank. An easier— and more cost-efficient—solution was needed. Frank Yellin. This effort ultimately led to the creation of Java. In an attempt to find such a solution. Jonathan Payne. As java is platform independent.1 The Creation of Java :Java was conceived by James Gosling. Between the initial implementation of Oak in the fall of 1992 and the public announcement of Java in the spring of 1995.1. This language was initially called “Oak” but was renamed “Java” in 1995. Gosling and others began work on a portable. It took 18 months to develop the first working version. the original impetus for Java was not the Internet! Instead. Chris Warth. Although the fundamental forces that necessitated the invention of Java are portability and security.Chapter 3 DESIGN DETAILS -----------------------------------------------------------------------------------------------------------This software has written in JAVA as frontend.1 JAVA :3. Patrick Naughton. many more people contributed to the design and evolution of the language. Although it is possible to compile a C++ program for just about any type of CPU. Arthur van Hoff. and Mike Sheridan at Sun Microsystems. platform-independent language that could be used to produce code that would run on a variety of CPUs under differing environments. the primary motivation was the need for a platform-independent (that is. Inc. and Tim Lindholm were key contributors to the maturing of the original prototype. to do so requires a full C++ compiler targeted for that CPU. in 1991. such as microwave ovens and remote controls. Following are details for java 3. Bill Joy.2 The Java Buzzwords :No discussion of the genesis of Java is complete without a look at the Java buzzwords. The Problem is that compilers are expensive and time-consuming to create. The key considerations were summed up by the Java team in the following list of buzzwords: 12 . 3. architecture-neutral) language that could be used to create software to be embedded in various consumer electronic devices.

2 The KeyListener Interface :This interface defines three methods.1.3.           Simple Secure Portable Object-oriented Robust Multithreaded Architecture-neutral Interpreted High performance Distributed Dynamic 3.3 Event Handling :3. 3. Those classes are in the Java package and include all the classes . interfaces. The keyPressed( ) and keyReleased( ) methods are invoked when a key is pressed and released. It can be generated as consequence of a person interacting with the elements in a graphical user interface. constructors.The Java Developer's Kit comes with documentation for all of the java class library. electing an item in a list. which includes descriptions of each class's instance variables. The keyTyped( ) method is invoked when a character has been entered. A shorter summary of the Java API is in appendix C as well.1. if a user presses and releases the A key.1 Events :Event is an object that describes a state change in a source. respectively. Some of the activities that cause events to be generated are pressing a button. entering a character via the keyboard. three events are generated in sequence: key pressed. typed. Exploring the Java class library and its methods and 13 . or API) via the web. two key events are generated in sequence: key pressed and released.3. and released. You can get to this documentation (called the Java Application Programmer's Interface. The general forms of these methods are shown here: void keyPressed(KeyEvent ke) void keyReleased(KeyEvent ke) void keyTyped(KeyEvent ke) 3.2 The Java Class Library :The Java class library provides the set of classes that are guaranteed to be available in any commercial Java environment. and so on.1. methods. and clicking the mouse. If a user presses and releases the HOME key. For example.

"Streams and I/O. Here are the class packages that are part of the Java class library:  java. as well as how it can become a starting point for your own development. In addition to the Java classes.lang. Check Box . such as Date. and other Tidbits. java.net. including socket and URL ( a class to represent references to documents on the World Wide Web) You'll learn a little about networking on "Windows. java. Button. using any Java ." describes  the classes in this package. including classes for Window." and then on "  Client/Server Networking in Java. java. java. Only classes inside the Java package are guaranteed to be available on all browsers and Java environments. It contains classes to implement graphical user interface features. and the system class. You will get at least a glance  at most of the classes in this package in this first week.instance variables is a great way to figure out what java can and cannot do. because they are not part of the standard Java library. Font.util– Utility classes. and so on).Classes to implement Java applets. Although these classes may be useful. because applets are expected to be able to run on any platform.  java. This is particularly important for applets. they may not be available to other people trying to run your java program unless you explicitly include those classes with your program. Menu. your development environment may also include additional classes that provide other utilities or functionality. as well as simple collection classes such as  vector and Hash table.enabled browser.awt. including the Object class. 14 .Classes for networking support. the string class. float.Classes that apply to the language itself.This is the abstract Windowing Toolkit.applet. networking.Input and output classes for writing to and reading from streams ( such as standard input and output ) and for handling files. It also contains the special classes for the primitive types (Integer.io. character. You'll learn more about these classes in the Bonus week. and so on It also includes mechanisms for managing system events and for processing images.

and repainting. positioning and sizing the window. Figure 3. and 15 . text. All user interface elements that are displayed on the screen and that interact with the user are subclasses of Component. such as mouse and keyboard input. 3. Component is an abstract class that encapsulates all of the attributes of a visual component. The two most common windows are those derived from Panel.3.1 Applet Hierarchy 3. Thus. scroll bars.1 shows the class hierarchy for Panel and Frame. Much of the functionality of these windows is derived from their parent classes. which is used by applets. which creates a standard window.1 Component :At the top of the AWT hierarchy is the Component class.3 Window Fundamentals :The AWT defines windows according to a class hierarchy that adds functionality and specificity with each level. and those derived from Frame. Class Description ScrollPane a container that provides horizontal and/or vertical scroll bars for another component. System Color contains the colors of GUI widgets such as windows. a description of the class hierarchies relating to these two classes is fundamental to their understanding. It defines over a hundred public methods that are responsible for managing events. A Component object is responsible for remembering the current foreground and background colors and the currently selected text font. 3.Fig.

the applet viewer provides the title and border. Once these components have been added. This is why you don’t see these items when an applet is run inside a browser. It does this through the use of various layout managers.others. menu bar. a Panel is a window that does not contain a title bar.3. it simply implements Container. it is drawn on the surface of a Panel object. 3. and no title. This makes for a multileveled containment system. setSize( ). you can position and resize them manually using the setLocation( ). It has additional methods that allow other Component objects to be nested within it. or border.2 Container :The Container class is a subclass of Component. A container is responsible for laying out any components that it contains.3.3. When screen output is directed to an applet. Panel is the super class for Applet. When you run an applet using an applet viewer. TextComponent A superclass for TextArea and TextField. Fig. Other Container objects can be stored inside of a Container. Toolkit abstract class implemented by the AWT. TextField Creates a single-line edit control. In essence. no menu bar.2The class hierarchy for Panel and Frame 16 . Other components can be added to a Panel object by its add( ) method from. concrete screen component. TextArea Creates a multiline edit control. or setBounds( ) methods defined by Component. Window Creates a window with no frame. 3. A Panel may be thought of as a recursively nestable.3 Panel :The Panel class is a concrete subclass of Container. It doesn’t add any new methods.

menu bar. This project provides multi-platform facility which avoids confusion of user for using different commands. If you create a Frame object from within an applet. such as “Java Applet Window.4 Window :The Window class creates a top-level window.5 Frame :Frame encapsulates what is commonly thought of as a “window. the above panel show output or operation of commands and as in second panel accept the commands. Generally. a normal window is created. This terminal can be installed dynamically and can be used virtually. Instead. When a Frame window is created by a program rather than an applet. From two panels. borders. you won’t create Window objects directly. it will contain a warning message. 3. you will use a subclass of Window called Frame.” to the user that an applet window has been created. it sits directly on the desktop. 17 . As user has to remember different commands used in different operating system this difficulty can be avoided by this multi-platform virtual terminal. described next. The default command prompts are statically installed in operating system.” It is a subclass of Window and has a title bar. CONCLUSION -----------------------------------------------------------------------------------------------------------Thus. It has its own inbuilt commands which are same for all operating system and can be run manually. This message warns users that the window they see was started by an applet and not by software running on their computer. This can be dynamically installed on any operating system. The project consists of one window which has two panels.3.3. A top-level window is not contained within any other object.3. and resizing corners. we implemented project on “Multi-platform based Virtual Terminal”.

Pressman. by Microsoft. William E.REFERENCES ------------------------------------------------------------------------------------------------------[1] “Complete Reference Java”. [4] “Software Engineering” by Roger S. Shields. Shotts. [2] “The Linux Command Line”. 18 . [3] “Windows command line reference”. By H.