ooad record

136
TAMILNADU COLLEGE OF ENGINEERING KARUMATHAMPATTI COIMBATORE – 641 659 LABORATORY RECORD Name : …………………………………………… Class : …………………………………………… Branch : …………………………………………… Subject : ……………………………………………. UNIVERSITY REGISTER NO. ROLL NO. This is to certify that this is a bonafide record of work done by the above student in Laboratory during the academic year/semester

Upload: blacklistrivals711

Post on 21-Nov-2014

119 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Ooad Record

TAMILNADU COLLEGE OF ENGINEERING

KARUMATHAMPATTI

COIMBATORE – 641 659

LABORATORY RECORD

Name : ……………………………………………

Class : ……………………………………………

Branch : ……………………………………………

Subject : …………………………………………….

UNIVERSITY REGISTER NO. ROLL NO.

This is to certify that this is a bonafide record of work done by the above student in

Laboratory during the academic year/semester

STAFF IN-CHARGE HEAD OF THE DEPARTMENT

Submitted for the practical examination held on ………………………………………….

INTERNAL EXAMINER EXTERNAL EXAMINER

Page 2: Ooad Record

STUDENTS MARKS ANALYSIS SYSTEM

S.NO DATE TITLE PAGE.NO SIGN

1. Problem Analysis and project planning

2. Generating Use case diagram, Class diagram, Activity diagram, Sequence diagram, collaboration, component and deployment diagram using rational Rose

3. Rose implementation

4. Coding

5. Screen Shots

Page 3: Ooad Record

STOCK MAINTENANCE SYSTEM

S.NO DATE TITLE PAGE.NO SIGN

1. Problem Analysis and project planning

2. Generating Use case diagram, Class diagram, Activity diagram, Sequence diagram, collaboration, component and deployment diagram using rational Rose

3. Rose implementation

4. Coding

5. Screen Shots

Page 4: Ooad Record

PAYROLL MANAGEMENT SYSTEM

S.NO DATE TITLE PAGE.NO SIGN

1. Problem Analysis and project planning

2. Generating Use case diagram, Class diagram, Activity diagram, Sequence diagram, collaboration, component and deployment diagram using rational Rose

3. Rose implementation

4. Coding

Page 5: Ooad Record

STUDENT MARKS ANALYZING SYSTEM

Page 6: Ooad Record

STUDENT MARKS ANALYZING SYSTEM

PROGRAM ANALYSIS AND PROJECT PLANNING:

Thorough study of the problem:

The student marks analyzing system is developed for easy analysis of marks and it can be accessed by any person like students, staffs etc…

The student has following features: Authentication to login to the system, a username and password is

asked. It also contains the details of students like name, roll no, dept,

Semester marks etc Students can view their analyzed report. It gives all details about

his/her marks.

Identify project scope

Any person like student, staff, etc can view marks and reports. Authentication is provided using password and username of both student and

staffs.

Objectives:

To design a model for the Student Marks analyzingsystem using UML and generate code using VB.

Infrastructure:

a) Hardware Requirements :PCb) Software Requirements:

Platform: Windows xp/98/me Front end tool: Microsoft Visual Basic 6.0 Back end tool: Microsoft access

MODULES:

The modules of the project are Login Student details Student mark details

MODULE DELIVERABLES

Page 7: Ooad Record

Login:

Brief description:

The use case describes hoe a user logs into student information management system.

Flow of events:

\1. Basic flow:

The use case sorts when the user wishes to log into the system.

The system request the actor to enter his/her name and password The actor enters name and password. The system validates the entered name and password and logs into

the system.

2. Alternate flow:

invalid name/password

If in the basic flow the actor enters the invalid name or password the system displays error message .The actor is providing with another chance to enter correct one or exit from the system

3. Special requirements:

None

4. Precondition:

The actor should select any category

5. Post condition:

If the use case was successful, the actor is now logged into the system. If not the system state is unchanged

Student details:

Brief description

Page 8: Ooad Record

This use case allows the user to maintain student information in the student details and generate the report .This includes adding, searching, updating student detail from the system.

Add:

Flow of events:

1. Basic flow:

The use case adds when the user wishes to add the student details in the database system.

The system request the actor to enter student details The actor enters student details The system validates will save the student details into the database

system. If the user selects add function then add sub flow is executed

2. Alternate flow:

invalid data item

If in the basic flow the actor enters the invalid data item the system displays error message .The actor is providing with another chance to enter correct one or exit from the system

3. Special requirements:

None

4. Precondition:

use case will connect to the entry form interface.

5. Post condition:

If the use case was successful, the actor is now adding the student details into the database system. If not the system state is unchanged

Search:

Flow of events:

1. Basic flow

Page 9: Ooad Record

When the user wants to search particular record from system he can initialize search function.

If the user selects search function then search sub flow is executed.

2. Alternate flow:

invalid data item

If in the basic flow the actor enters the invalid data item the system displays error message .The actor is providing with another chance to enter correct one or exit from the system

3. Special requirements:

None

4. Precondition:

use case will connect to the search form interface.

5. Post condition:

If the use case was successful, then actor will search the particular record and display the student details. If not, the system state is unchanged.

Update:

Flow of events:

1. Basic flow

When the user wants to update particular record from system he can initialize update function.

If the user selects update function then update sub flow is executed.

2. Alternate flow:

invalid data item

If in the basic flow the actor enters the invalid data item the system displays error message .The actor is providing with another chance to enter correct one or exit from the system

3. Special requirements:

None

4. Precondition:

Page 10: Ooad Record

use case will connect to the update form interface.

5. Post condition:

If the use case was successful, the actor is now update the student details and saves that into the database system. If not, the system state is unchanged.

Delete:

Flow of events:

1. Basic flow

When the user wants to delete particular record from system he can initialize delete function.

If the user selects delete function then delete sub flow is executed.

2. Alternate flow:

invalid data item

If in the basic flow the actor enters the invalid data item the system displays error message .The actor is providing with another chance to enter correct one or exit from the system

3. Special requirements:

None

4. Precondition:

use case will connect to the delete form interface.

5. Post condition:

If the use case was successful, then actor will delete the particular record and display the student details. If not, the system state is unchanged.

GENERATING USE CASE DIAGRAM ,CLASS DIAGRAM , STATE CHART DIAGRAM , ACTIVITY DIAGRAM USING RATIONAL ROSE

DESCRIPTION:

(i) Use Case diagram:

It shows some of the use cases, actors in the Student InformationSystem and the relationships between them.

Page 11: Ooad Record

Use case is a high level piece of functionality that the system will provide.An actor is anything or anyone that interacts with the system being built

(ii) Class diagram: A class is a set of objects that share a common structure and common behavior (the same attributes, operations, relationships and semantics). A class is an abstraction o real-world items. When these items exist in the real world, they are instances of the class and are referred to as objects The attribute and operation sections of the class box can be suppressed to reduce detail in an overview. Suppressing a section makes no statement absence of attributes or operations, but drawing an empty section explicitly states that there are no elements in that part.

(iii) State Transition Diagram & Activity Diagram:

A state transition diagram shows the life cycle of a single object from the time it is created until it is destroyed. These diagrams are a good way to model the dynamic behavior of a class.

In Rose, no source code is generated from a state transition diagram. These diagrams serve to document the dynamic behavior of a class so that developers and analysts well have a clear understanding of the behavior.

To create a state transition diagram:1. Right click the desired class in the browser.2. Select “open state diagram” from the pop up menu.

Adding states: 1. To add a state, select state from the tool box bar.2. Click on the state transition diagram where the state should appear.

To add an activity:

1. Open a specification window for the desired state.2. Select the detail lab.3. Right click on the actins box.4. Select “insert” from the pop up menu.5. Double click the new action. Enter the action in the actions field.6. In the when box, select “enter until exit” to make the new action an

activity.

USE CASE DIAGRAM

Page 12: Ooad Record

Update Record

Student View Record

Add Record

Search Record

Delete Record

Staff

Login

Username & Password

Username & Password

Enter Details

Enter Regno.

Enter Regno.

CLASS DIAGRAM

Page 13: Ooad Record

Search Record

nameregnodeptsem_marks

search()

Delete Record

nameregnodeptsem_marks

delete()

View Record

nameregnodeptsem_marks

display()

Student Marklist Analysis System

Add Record

nameregnodeptsem_marks

add()

ACTIVITY DIAGRAM

ACTIVITY DIAGRAM FOR STUDENT

Page 14: Ooad Record

Student Marklist

Enter Regno.

Display Error Message

Display Record

Regno found?

Yes

No

ACTIVITY DIAGRAM FOR STAFF

Page 15: Ooad Record

Student Marklist

Enter Type

Add Record

Search Record

Delete Record

Enter Details

View Record

Delete Detail

Provide Error Message

Reg no Found?

Yes

Reg no Found?Reg no Found?

YesNo

Yes NoNo

STATE CHART DIAGRAMS

Page 16: Ooad Record

Add Record:

Checking

Rejected

Add to Database

/ get student Regno.

Regno not found

Regno found

Search Record:

Checking

Rejected

Display Details

/ get student Regno.

Valid Regno

Invalid Regno

Delete Record:

Page 17: Ooad Record

Checking

Rejected

Delete Record

/ get student Regno.

Valid Regno

Invalid Regno

View Record:

Checking

Rejected

View Record

/ get student Regno.

Valid Regno

Invalid Regno

GENERATING SEQUENCE DIAGRAM,COLLABORATION DIAGRAM,COMPONENT DIAGRAM ,DEPLOYMENT DIAGRAM USING RATIONAL ROSE

Page 18: Ooad Record

DESCRIPTION:

(i) Sequence Diagrams: They are ordered by time. They are useful if someone wants to review the

flow of logic through a scenario. Although collaboration diagrams include sequencing information, it is easier to see on a sequence diagram.

Creating a sequence diagram:

1. Right click the appropriate package/use case in the browser. 2. From the short cut menu,select new -> Sequence diagram.3. Name the new sequence diagram.4. Double-click the new sequence diagram in the browser to open it.

To add an item to the sequence diagram: 1. Use the tool bar buttons to add objects and messages to the diagram.

To remove an item from the sequence diagram:

1. Select the item on the sequence diagram.2. Select Edit-> Delete from model (or) press ctrl+D.

(ii) Collaboration Diagram: Like sequence diagrams,collaboration diagrams are used to show the flow through a specific scenario of a use case. collaborations diagrams focus on more on the relationship between the objects, While sequence diagrams are ordered by time.

To create a new collaboration Diagram:

1. Right click the appropriate use case in the browser.2. From the short cut menu, select new->collaboration diagram.3. Name the new collaboration diagram.4. double click the new collaboration diagram in the browser to open it.

Deleting a collaboration diagram: 1. Right click the collaboration diagram in the browser. 2. Select delete from the short cut menu.

(iii) Component Diagram:

The component diagram is a uml diagram that displays the components in the system and dependencies between them. A component is a physical module of a code. Components can include both source code libraries and Runtime files.once the components are created, they are added to a component diagram and relationships are

Page 19: Ooad Record

drawn between them.the only type of a relationship between components is a dependency.a dependency suggests that one component must be compiled before another.

To create a component diagram in the component view:

1. In the browser ,Right click the package to contain the component diagram.2. select new ->component diagram from the pop up menu.3. Enter the name of the new component diagram.

To delete a component diagram in the component view:

1.In the browser , Right click the component diagram.2. Select delete from the pop up menu.

iv)Deployment diagram:

A deployment diagram shows allow the modes on the network,the connections between them and the process that will run on each one.

Opening the deployment diagram:

1. To open the deployment diagram, double click the deployment view in the browser. 2 .Rose will open the deployment diagram for the model.

Adding processors:A processor is any machine that has a processing power.

To add a processor:

1. Select processor from the toolbox.2. click the deployment diagram to place the processor.3. enter the name of the processor.

To Delete a processor from the Model:

1. Select the processor on the deployment diagram.2. Select edit -> Delete from model or press ctrl+D.

Adding Devices:

A device is a machine or piece of hardware without processing power. Devices include items such as dumb terminals,printers and scanners.

To add a device:

1. Select device from the toolbox.2. Click the deployment to place the device.3. Enter the name of the device.

To Delete a device from the model:

Page 20: Ooad Record

1. Select the device on the deployment diagram.2. Select Edit -> Delete from model or press ctrl + D.

Adding connections:

A connection is a physical link between two processors., two devices , or a processor and a device.

To add a connection:

1. Select connection from the toolbox.2. Click on the node to connect.3. Drag the connection link to another node.

To Delete a connection from the model:

1. Select the connection on the deployment diagram.2. Select edit -> Delete from model or press ctrl + d

SEQUENCE DIAGRAM

ADD RECORD SEQUENCE DIAGRAM

Page 21: Ooad Record

Staff System Database

1.Request to Add

2.Enter Regno.

3.Check Regno.

4.Check Database

5.Return Status

6.Details Added

7.Terminate

SEQUENCE RECORD FOR SEARCH RECORD

Page 22: Ooad Record

Staff System Database

1.Request to Search

2.Enter Regno.

3.Check Regno. Availability

4.Check Database

5.Return Status

6.Details Displayed

7.Terminate

SEQUENCE DIAGRAM FOR DELETE RECORD

Staff System Database

1.Request to Delete

2.Enter Regno.

3.Check Regno. Availability

4.Check Database

5.Return Status

6.Details Deleted

7.Terminate

SEQUENCE DIAGRAM FOR VIEW RECORD

Page 23: Ooad Record

Student System Database

1.Request to View Record

2.Enter Regno.

3.Check Regno. Availability

4.Check Database

5.Return Status

6.View Record

7.Terminate

COLLABORATION DIAGRAM S;

Collaboration Diagram for Add Record:

Staff System

Database

1: 1.Request to Add

2: 2.Enter Regno.

3: 3.Check Regno.4: 4.Check Database

5: 5.Return Status

6: 6.Details Added

7: 7.Terminate

Collaboration Diagram for Search Record:

Page 24: Ooad Record

Staff System

Database

1: 1.Request to Search

2: 2.Enter Regno.

3: 3.Check Regno. Availability4: 4.Check Database

5: 5.Return Status

6: 6.Details Displayed

7: 7.Terminate

Collaboration Diagram for Delete Record:

Staff System

Database

1: 1.Request to Delete

2: 2.Enter Regno.

3: 3.Check Regno. Availability4: 4.Check Database

5: 5.Return Status

6: 6.Details Deleted

7: 7.Terminate

Collaboration Diagram for view Record:

Page 25: Ooad Record

Student System

Database

1: 1.Request to View Record

2: 2.Enter Regno.

3: 3.Check Regno. Availability4: 4.Check Database

5: 5.Return Status

6: 6.View Record

7: 7.Terminate

COMPONENT DIAGRAM:

Login

Student Details

Database

DEPLOYMENT DIAGRAM:

Page 26: Ooad Record

Database

Add Search Delete View

StaffStudent

RATIONAL ROSE IMPLEMENTATION

Page 27: Ooad Record

PROCEDURE:

REVERSE ENGINEERING:

1. Select tools -> visual basic -> component assignment tool.2. Create new component by right click on visual basic.3. Right click on project1 properties and select project for which code should be

generated.4. Select tools -> visual basic -> update model from code.5. Select the check box for which code should be generated and click next.6. Click finish and save the model.

CODINGS: FORM1: HOME PAGE

Private Sub Command1_Click()Form2.ShowEnd Sub

Private Sub Command2_Click()Form13.ShowEnd Sub

Private Sub Command3_Click()EndEnd Sub

FORM2 : STAFF LOGINPrivate Sub Command1_Click()If (Text1.Text = "STAFF" And Text2.Text = "STAFF") Then Text1.Text = " " Text2.Text = " " MsgBox ("Login success") Form3.Show Else MsgBox ("Login failed") End IfEnd Sub

Private Sub Command2_Click()Me.HideEnd Sub

FORM 3:STUDENT DETAILSPrivate Sub Command1_Click()

Page 28: Ooad Record

Data1.Recordset.AddNewMsgBox ("Enter the field required and click save")End Sub

Private Sub Command2_Click()MsgBox ("Record inserted")Data1.Recordset.UpdateEnd Sub

Private Sub Command3_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command4_Click()Dim a, f As Integera = InputBox("ENTER REG.NO TO DELETE")f = 0Data1.Recordset.MoveFirstDoIf (Data1.Recordset("REG NO") = Val(a)) Thenf = 1Data1.Recordset.DeleteMsgBox ("RECORD DELTED")Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command5_Click()Form4.ShowEnd Sub

Private Sub Command6_Click()Me.Hide

Page 29: Ooad Record

End Sub

FORM 4: SEM1 DETAILSPrivate Sub Command2_Click()Data1.Recordset.AddNewMsgBox ("Record updated")Data1.Recordset.UpdateEnd Sub

Private Sub Command3_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command5_Click()Form4.Text7.Text = (Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 5End Sub

Private Sub Command6_Click()Form5.ShowEnd Sub

FORM 5: SEM2 DETAILSPrivate Sub Command2_Click()Data1.Recordset.AddNewMsgBox ("Record updated")Data1.Recordset.UpdateEnd Sub

Private Sub Command3_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDo

Page 30: Ooad Record

If (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command5_Click()Form5.Text7.Text = (Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 5End Sub

Private Sub Command6_Click()Form6.ShowEnd Sub

FORM 6:SEM 3 DETAILSPrivate Sub Command2_Click()Data1.Recordset.AddNewMsgBox ("Record updated")Data1.Recordset.UpdateEnd Sub

Private Sub Command3_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command5_Click()

Page 31: Ooad Record

Form6.Text7.Text = (Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 5End Sub

Private Sub Command6_Click()Form7.ShowEnd Sub

FORM7 : SEM 4 DETAILSPrivate Sub Command2_Click()Data1.Recordset.AddNewMsgBox ("Record updated")Data1.Recordset.UpdateEnd Sub

Private Sub Command3_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command5_Click()Form7.Text7.Text = (Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 5End Sub

Private Sub Command6_Click()Form8.ShowEnd Sub

FORM 8:SEM 5 DETAILSPrivate Sub Command2_Click()Data1.Recordset.AddNewMsgBox ("Record updated")Data1.Recordset.UpdateEnd Sub

Private Sub Command3_Click()

Page 32: Ooad Record

Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command5_Click()Form8.Text7.Text = (Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 5End Sub

Private Sub Command6_Click()Form9.ShowEnd Sub

FORM 9: SEM 6 DERAILSPrivate Sub Command2_Click()Data1.Recordset.AddNewMsgBox ("Record updated")Data1.Recordset.UpdateEnd Sub

Private Sub Command3_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Page 33: Ooad Record

Private Sub Command5_Click()Form9.Text7.Text = (Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 5End Sub

Private Sub Command6_Click()Form10.ShowEnd Sub

FORM10:SEM 7Private Sub Command2_Click()Data1.Recordset.AddNewMsgBox ("Record updated")Data1.Recordset.UpdateEnd Sub

Private Sub Command3_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command5_Click()Form10.Text7.Text = (Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 5End Sub

Private Sub Command6_Click()Form511.ShowEnd Sub

FORM 11: SEM 8Private Sub Command2_Click()Data1.Recordset.AddNewMsgBox ("Record updated")Data1.Recordset.UpdateEnd Sub

Page 34: Ooad Record

Private Sub Command3_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command5_Click()Form11.Text7.Text = (Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 5End Sub

Private Sub Command6_Click()Form12.ShowEnd Sub

FORM 12:STUDENT RECORDPrivate Sub Command1_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Page 35: Ooad Record

Private Sub Command2_Click()Form12.Text11.Text = (Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text) + Val(Text7.Text) + Val(Text8.Text) + Val(Text9.Text) + Val(Text10.Text)) / 8End Sub

Private Sub Command3_Click()Form1.ShowEnd Sub

FORM 13: STUDENT LOGINPrivate Sub Command1_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command2_Click()Form12.Text11.Text = (Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text) + Val(Text7.Text) + Val(Text8.Text) + Val(Text9.Text) + Val(Text10.Text)) / 8End Sub

Private Sub Command3_Click()Form1.ShowEnd Sub

FORM 14:STUD MARK LISTPrivate Sub Command1_Click()Dim a, f As Integera = InputBox("Enter register number to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("REG NO")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNext

Page 36: Ooad Record

Loop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command2_Click()EndEnd Sub

Page 37: Ooad Record

OUTPUT

FORM1:HOME PAGE:

FORM2:STAFF LOGIN:

FORM3: STUDENT DETAILSADD:

Page 38: Ooad Record

SAVE:

SEARCH:

Page 39: Ooad Record

DELETE

Page 40: Ooad Record

FORM4: SEMESTER MARKS

Page 41: Ooad Record

SEARCHING STUDENT MARKS:

Page 42: Ooad Record

FORM13: STUDENT LOGIN

Page 43: Ooad Record

FORM14:STUDENTS FULL MARK LIST

Page 44: Ooad Record
Page 45: Ooad Record

Result:

Thus the implementation of STUDENT MARKS ANALYZING SYSTEM is developed in visual basic and output is tested using rational rose software.

Page 46: Ooad Record

STOCK MAINTENANCE SYSTEM

STOCK MAINTENANCE SYSTEM

Page 47: Ooad Record

PROGRAM ANALYSIS AND PROJECT PLANNING:

PROBLEM STATEMENT:

In any organization the records about stock are maintained manually. Since these activities are done manually and need regular updates to these records there is much probability of error occurrence, moreover this work is a tedious work process. The various activities involved in these types of systems are:

Adding stock Deleting stock Updating stock Searching stock

The problems faced by maintaining this system manually are While adding the product manually, there may be a chance of missing its detail in

a large database. While deleting the product, it takes time to search that particular product in a

large database. As we are maintaining a large database, updating a product is difficult. The amount of time taken to search a particular product in a large database is high

if the searching is done manually. The additional work of generating the reports on some timely basis is also

involved in this.

ANALYSIS REPORT:

In order to overcome the major flaws of the manual record maintenance the shift towards computerization of the process is mandatory .The primary objective of this project is to implement the software which is capable of maintenance of the records with simplicity and in well structured manner.

THOROUGH STUDY OF THE PROBLEM:

Stock maintenance system has to be developed for maintaining the stock list of a stationary stock company.

Automatic ordering of stock when the stock reaches minimum stock balance Checking stock list for minimum balance. Get minimum and maximum number of each product in the stock (product list of

stock list). Products list contains product name, product id, maximum and minimum

products. Current list contains number of items currently present in the stock o;f each

product. Reduce the number of items in the current list, after ordering of the customer

according to the product. Product show list of the name of the product available in the market.

. When the current list quantity is less than for a particular product then the

product is order to the company, according to the constrain given in the product list.

Page 48: Ooad Record

Updating the stock list and current list with the newly purchased product. In the product list, there is an additional option demand for increasing quantity of

a particular product in the stock. During the time of the demand, the option should be selected.

The system access given to the accountant, stock manager.

Identify project scope:

The scope of the product is to maintain stock in a stationary stock company. To calculate the available quantity of a particular product presently in the stock. It’s easy to add to the stock list, when there is an arrival of a new product to the

super market. When a particular product reaches a minimum level then automatically it types

letter with the required quantity of product to the product company.

Objectives:

The main aim of the project is to maintain the stock list details & company address of each product, inform the stock manager when the action is required to be taken.

The project avoids excess ordering of the stock and order necessary stock when the stock goes beneath the minimum level specified.

When the particular product reaches minimum level then it should type the letter automatically to the particularly company.

Stock maintenance using UML and generate code using VB

Page 49: Ooad Record

PROCEDURE:

STEPS: 1. Start the process. 2. Design the Use case diagram using UML. 3. Design the Sequence diagram. 4. Obtain Collaboration diagram from Sequence diagram. 5. Design the class diagram for Hospital Management System corresponding attributes and operations. 6. Design the component diagram and choose the VB to generate code for analysis specified. 7. Design deployment diagram. 8. Link the class in class diagram with component in component diagram. 9. Update model which designed. 10. The VB code is generated. 11. Stop the process.

SYSTEM SPECIFICATION:

c) Hardware Specification:

1. A server to store all the data and for doing transaction.2. a client machine to interact with user3. a printer to print the receipts

d) Software Specification:

1. A DB server like oracle, MS SQL server.2. A front end software like VB3. A networking OS like LINUX, WINDOWS 2000 Server etc.,

MODULES:

The modules of the project are

1) Login2) Add stock details3) Delete stock details4) Search5) Update stock details6) Bill receipt.

MODULE DELIVERABLES:

1. LOGIN:

Page 50: Ooad Record

Brief description:

The use case describes how a user logs into stock maintenance.

Flow of events:

1. Basic flow:

The use case sorts when the user wishes to log into the system.

The system request the actor to enter his/her name and password

The actor enters name and password. The system validates the entered name and password and

logs into

2. Alternate flow:

Invalid user name/password

If in the basic flow the actor enters the invalid name or password

The system displays error message .the actor is providing with

Another chance to enter corrects one or exit from the system

3. Special requirements:

None

4. Precondition:

The actor should select any category

5. Post condition:

If the use case was successful, the actor is now logged into the system. If not the system state is unchanged

2. ADD STOCK DETAILS:

Brief description:

The use case describes how to add the stock

Flow of events:

Page 51: Ooad Record

1. Basic flow:

The use case sorts when the user wishes to add the stock.

The system request the actor to enter the pr_id, pr_name, com_name, cost, quantity

After entering the above details the system displays the message that the stock is added successfully

2. Alternate flow:

Copy of product id.

If we enter the already existing pr_id, it will not be added in the stock.

3. Special requirements:

None

4. Precondition:

The actor should enter the pr_id

5. Post condition:

If the use case was successful, the item is now added into the system. If not the system state is unchanged

3. DELETE STOCK:

Brief description:

The use case describes how to delete the stock.

Flow of events:

1. Basic flow:

The use case sorts when the user wishes to delete the stock.

The system request the actor to enter the pr_id. After entering the pr_id the system displays the message

that the stock is deleted successfully

2. Alternate flow:

Invalid product id.

If we enter the invalid pr_id, it will not be deleted from the stock.

Page 52: Ooad Record

3. Special requirements:

None

4. Precondition:

The actor should enter the pr_id

5. Post condition:

If the use case was successful, the item is now deleted into the system. If not the system state is unchanged

4. SEARCH STOCK:

Brief description:

The use case describes how to search the product from stock.

Flow of events:

1.Basic flow:

The use case sorts when the user wishes to search from the stock.

The system requests the actor to enter the pr_name. After entering the pr_name the system displays details of

the product.

2. Alternate flow:

Invalid product name.

If we enter the invalid pr_name, it will not be searched.

3. Special requirements:

None

4. Precondition:

The actor should enter the pr_name

5. Post condition:

If the use case was successful, the items are now searched and display the details of the product.

5. UPDATE STOCK:

Page 53: Ooad Record

Brief description:

The use case describes how to update the product from stock.

Flow of events:

1. Basic flow:

The use case sorts when the user wishes to update the stock.

The system requests the actor to enter the pr_id. After entering the pr_id the system displays details of the

product and updated.

2. Alternate flow:

Invalid product name.

If we enter the invalid pr_name, it will not be searched.

3. Special requirements:

None

4. Precondition:

The actor should enter the pr_name

5. Post condition:

If the use case was successful, the items are now searched and display the details of the product.

6. PRODUCT DETAILS:

Brief description:

The use case describes how to display the bill for the product purchased.

Flow of events:

1. Basic flow:

Page 54: Ooad Record

The use case sorts when the user wishes to display the product details.

The system requests the actor to enter the quantity and name of the

Product. After entering the details the product details are displayed

and remaining items are shown.

2. Alternate flow:

None.

3. Special requirements:

None

4. Precondition:

The actor should enter the pr_name .

5. Post condition:

If the use case was successful, the product details.are displayed

.

GENERATING USE CASE DIAGRAM, CLASS DIAGRAM, STATE CHART DIAGRAM, ACTIVITY DIAGRAM USING RATIONAL ROSE

PROCEDURE:

1. Start Rational Rose Enterprise Edition.2. Create New Use case view.3. Draw the Use case diagram.4. Draw the corresponding Class diagram.5. Draw the state chart and activity diagram.

Page 55: Ooad Record

6. Stop the program

DESCRIPTION:

(iv)Use Case diagram:

It shows some of the use cases, actors in the STOCK MAINTENANCE system and the relationships between them.

Use case is a high level piece of functionality that the system will provide. An actor is anything or anyone that interacts with the system being built

(v) Class diagram: A class is a set of objects that share a common structure and common behavior (the same attributes, operations, relationships and semantics). A class is an abstraction o real-world items. When these items exist in the real world, they are instances of the class and are referred to as objects The attribute and operation sections of the class box can be suppressed to reduce detail in an overview. Suppressing a section makes no statement absence of attributes or operations, but drawing an empty section explicitly states that there are no elements in that part.

(vi)State Transition Diagram & Activity Diagram:

A state transition diagram shows the life cycle of a single object from the time it is created until it is destroyed. These diagrams are a good way to model the dynamic behavior of a class.

In Rose, no source code is generated from a state transition diagram. These diagrams serve to document the dynamic behavior of a class so that developers and analysts well have a clear understanding of the behavior.

To create a state transition diagram:1. Right click the desired class in the browser.2. Select “open state diagram” from the pop up menu.

Adding states:

1. To add a state, select state from the tool box bar.2. Click on the state transition diagram where the state should appear.

To add an activity:

1. Open a specification window for the desired state.2. Select the detail lab.3. Right click on the actins box.4. Select “insert” from the pop up menu.5. Double click the new action. Enter the action in the actions field.

Page 56: Ooad Record

6. In the when box, select “enter until exit” to make the new action an activity.

\USE CASE DIAGRAM

Page 57: Ooad Record

CLASS DIAGRAM

Data base

System startup

Add Items

Delete Items

Search Items

Update Items

Bill receipt

Administrator

Switch on/off

Enter details

Enter Pr_id

Enter name

Enter Pr_id

Enter Pr_id

Customer

Page 58: Ooad Record

STOCK MAINTAINANCE

ADD PRODUCTpr_namepr_idcomp_namecostquantity

add()

DELETE PRODUCTpr_namepr_idcomp_namecostquantity

delete()

SEARCH PRODUCTpr_namepr_idcomp_namecostquantity

search()

UPDATE PRODUCTpr_namepr_idcomp_namecostquantity

update()

BILLpr_namepr_idcomp_namecostquantity

bill()

Page 59: Ooad Record

ACTIVITY DIAGRAM

ADD RECORD ACTIVITY DIAGRAM

SEARCH RECORD ACTIVITY DIAGRAM

stock maintainance

add product

delete product

search product

update product

bill receipt

enter details

delete Items

display details

update Items

provide error

pr_id found

no

yes

pr_name found

yes

no

pr_id found

yes

no

pr_id found

yes

no

pr_name found

Stock maintaince

Enter Product id

Product id found

Enter product details

No

Error message

Yes

Page 60: Ooad Record

DELETE RECORD ACTIVITY DIAGRAM

STATE CHART DIAGRAM

Stock maintanence

Enter Pr_id

Pr_id found?Display Items

detailsYes

Provide Error

No

Stock maintaince

Enter Product id

Product id found

reject

No

delete details

Yes

Page 61: Ooad Record

ADD STOCK:

SEARCH STOCK

DELETE STOCK:

checking Add to database

rejected

/get product id

[product id not available]

[ product id present]

checking print details

rejected

/get product id

[valid product id]

[invalid product id]

checking delete details

rejected

/get product id

[valid product id]

[invalid product id]

Page 62: Ooad Record

GENERATING SEQUENCE DIAGRAM, COLLABORATION DIAGRAM, COMPONENT DIAGRAM, DEPLOYMENT DIAGRAM USING RATIONAL ROSE

PROCEDURE:

1. Start Rational Rose Enterprise Edition. 2. Create New Use case view. 3. Draw the use case diagram. 4. Draw the corresponding Class diagram. 5. Draw the state chart and activity diagrams. 6. Stop the program.

DESCRIPTION:

(i) Sequence Diagrams: They are ordered by time. They are useful if someone wants to review the

flow of logic through a scenario. Although collaboration diagrams include sequencing information, it is easier to see on a sequence diagram.

Creating a sequence diagram:

1. Right click the appropriate package/use case in the browser. 2. From the short cut menu, select new -> Sequence diagram. 3. Name the new sequence diagram. 4. Double-click the new sequence diagram in the browser to open it.To add an item to the sequence diagram: 1. Use the tool bar buttons to add objects and messages to the diagram.

To remove an item from the sequence diagram:

1. Select the item on the sequence diagram. 2. Select Edit-> Delete from model (or) press ctrl+D.

(ii) Collaboration Diagram: Like sequence diagrams, collaboration diagrams are used to show the flow through a specific scenario of a use case. Collaborations diagrams focus on more on the relationship between the objects, while sequence diagrams are ordered by time.

To create a new collaboration Diagram:

1. Right click the appropriate use case in the browser. 2. From the short cut menu, select new->collaboration diagram. 3. Name the new collaboration diagram. 4. Double click the new collaboration diagram in the browser to open it.

Page 63: Ooad Record

Deleting a collaboration diagram: 1. Right click the collaboration diagram in the browser. 2. Select delete from the short cut menu.

(iii) Component Diagram:

The component diagram is an uml diagram that displays the components in the system and dependencies between them. A component is a physical module of a code. Components can include both source code libraries and Runtime files. Once the components are created, they are added to a component diagram and relationships are drawn between them. The only type of a relationship between components is a dependency. A dependency suggests that one component must be compiled before another.

To create a component diagram in the component view:

1. In the browser, Right click the package to contain the component diagram.2. Select new ->component diagram from the pop up menu.3. Enter the name of the new component diagram.

To delete a component diagram in the component view:

1. In the browser, Right click the component diagram.2. Select delete from the pop up menu.

iv) Deployment diagram:

A deployment diagram shows allow the modes on the network, the connections between them and the process that will run on each one.

Opening the deployment diagram:

1. To open the deployment diagram, double click the deployment view in the browser.

2. Rose will open the deployment diagram for the model.

Adding processors:

A processor is any machine that has a processing power.

To add o processor:

1. Select processor from the toolbox.2. click the deployment diagram to place the processor.3. enter the name of the processor.

Page 64: Ooad Record

To Delete a processor from the Model:

1. Select the processor on the deployment diagram. 2. Select edit -> Delete from model or press ctrl+D.Adding Devices:

A device is a machine or piece of hardware without processing power. Devices include items such as dumb terminals, printers and scanners.

To add a device:

1. Select device from the toolbox. 2. Click the deployment to place the device. 3. Enter the name of the device.

To Delete a device from the model:

1. Select the device on the deployment diagram. 2. Select Edit -> Delete from model or press ctrl + D.

Adding connections:A connection is a physical link between two processors. two devices , or a processor and a device.

To add a connection:

1. Select connection from the toolbox. 2. Click on the node to connect.

3. Drag the connection link to another node.

To Delete a connection from the model:

1 .Select the connection on the deployment diagram. 2. Select edit -> Delete from model or press ctrl + d

Page 65: Ooad Record

SEQUENCE DIAGRAM

DELETE RECORD SEQUENCE DIAGRAM:

ADD RECORD SEQUENCE DIAGRAM:

System DatabaseAdministrator

1: request to delete

2: Enter pr_id3: Check for pro_id

4: Check Database

5: Return status

7: terminate

6: Item deleted

System DatabaseAdministrator

1: request to add

2: Enter details3: Check for pro_id

4: Check Database

5: Return status

7: terminate

6: Item added

Page 66: Ooad Record

UPDATE RECORD SEQUENCE DIAGRAM:

ADMINISTRATOR SYSTEM DATABASE

1: Request for update

2: Request Pr_id

3: Enter Pr_id

4: Check for Pr_id

5: Check Database

6: Return status

7: Request for updation

8: Update Item

9: Update Item

10: Update Database

11: Update Successful

12: Item Updated

13: Terminate

Page 67: Ooad Record

COLLABORATION DIAGRAM

ADD STOCK DETAILS:

Administrator

System

Database

4: Check database

1: request to add7: terminate

2: Enter details6: Item added

3: Check for pro_id

5: Return status

UPDATE STOCK DETAILS:

ADMINISTRATOR

SYSTEM

DATABASE

5: Check Database10: Update Database

1: Request for update3: Enter Pr_id8: Update Item13: Terminate

2: Request Pr_id7: Request for updation

12: Item updated

4: Check for Pr_id9: Update Item

6: Return status11: Update successful

Page 68: Ooad Record

DELETE RECORD FROM STOCK:

Administrator

System

Database

4: Check Database

1: request to delete7: terminate

2: Enter pr_id6: Item deleted

3: Check for pro_id

5: Return status

Page 69: Ooad Record

COMPONENT DIAGRAM:

LOGIN

STOCK DETAILS

DATABASE

DEPLOYMENT DIAGRAM:

ADD STOCK

SEARCH STOCK

DELETE STOCK

SAVE STOCK

ADMIN

DATABASE

Page 70: Ooad Record

RATIONAL ROSE IMPLEMENTATION

PROCEDURE:

REVERSE ENGINEERING:

1.Select tools -> visual basic -> component assignment tool.2. Create new component by right click on visual basic.3.Right click on project1 properties and select project for which code should be generated.4. Select tools -> visual basic -> update model from code.5. Select the check box for which code should be generated and click next.6. Click finish and save the model.

CODINGS:

FORM 1:LOGIN FORM

Private Sub Command1_Click()If (Text1.Text = "STOCK" And Text2.Text = "STOCK") Then Text1.Text = " " Text2.Text = " " MsgBox ("Login success") Form2.Show Else MsgBox ("Login failed") End IfEnd Sub

Private Sub Command2_Click()Me.HideEnd Sub

FORM 2:Private Sub Command1_Click()Form3.ShowEnd Sub

Private Sub Command2_Click()Form4.ShowEnd Sub

Private Sub Command3_Click()Form5.ShowEnd Sub

Page 71: Ooad Record

Private Sub Command4_Click()EndEnd Sub

FORM 3:SALES

Private Sub Form_Load()Set db = OpenDatabase("C:\STOCKK\STOCK.mdb")Set rs = db.OpenRecordset("ISSUE")End SubPrivate Sub Form_Paint()Data1.Recordset.AddNewEnd SubPrivate Sub Form_Unload(Cancel As Integer)Data1.Recordset.UpdateEnd SubPrivate Sub Command1_Click()Dim a As IntegerIf (a = Val(Text1.Text)) Thenrs.MoveFirstData1.Recordset.UpdateMsgBox "ITEM ISSUED"rs.MoveNextElseMsgBox ("ITEM CAN'T BE ISSUED")End IfEnd Sub

FORM 4: STOCK DETAILS

Private Sub Command1_Click()Data1.Recordset.AddNewMsgBox ("Enter the field required and click save")End Sub

Private Sub Command2_Click()MsgBox ("Record inserted")Data1.Recordset.UpdateEnd SubPrivate Sub Command5_Click()Dim a, f As Integera = InputBox("Enter product id to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("PID")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNext

Page 72: Ooad Record

Loop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("PRODUCT NOT FOUND")End IfEnd Sub

Private Sub Command3_Click()Dim a, f As Integera = InputBox("ENTER PRODUCT ID TO DELETE")f = 0Data1.Recordset.MoveFirstDoIf (Data1.Recordset("PID") = Val(a)) Thenf = 1Data1.Recordset.DeleteMsgBox ("PRODUCT DELTED")Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("PRODUCT NOT FOUND")End IfEnd Sub

FORM 5:PRODUCT DETAILS

Private Sub Command1_Click()Data1.Recordset.AddNewMsgBox ("Enter the field required and click save")End Sub

Private Sub Command2_Click()MsgBox ("Record inserted")Data1.Recordset.UpdateEnd SubPrivate Sub Command3_Click()Dim a, f As Integera = InputBox("Enter product id to search")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("PID")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)

If (f = 0) Then

Page 73: Ooad Record

MsgBox ("PRODUCT NOT FOUND")End IfEnd SubPrivate Sub Command4_Click()EndEnd SubPrivate Sub Command5_Click()Form2.ShowEnd Sub

Private Sub Command4_Click()Form2.ShowEnd Sub

Page 74: Ooad Record

OUTPUT:

LOGIN:

Page 75: Ooad Record

MAIN FROM: STOCK MAINTENANCE

ADD PRODUCT DETAILS:

Page 76: Ooad Record

SAVE PRODUCT DETAILS:

Page 77: Ooad Record

SEARCH PRODUCT:

Page 78: Ooad Record

STOCK DETAILS:ADD

SAVE:

Page 79: Ooad Record

SEARCH:

Page 80: Ooad Record

DELETE :

Page 81: Ooad Record

SALES DETAILS:

Page 82: Ooad Record

RESULT: Thus the implementation of STOCK MAINTENANCE system is developed using visual basic and output is tested using rational rose software.

Page 83: Ooad Record

PAYROLL SYSTEM

Page 84: Ooad Record

PAYROLL SYSTEM

PROGRAM ANALYSIS AND PROJECT PLANNING:

Thorough study of the problem:

The employee information management system is developed for easy maintaining employee details and it can be accessed by any person like employees, supervisors etc…

The employee has following features: Authentication to login to the system, a username and password is

asked. It also contains the details of employees like ename, eid, design, basic

pay , blood group, and address etc Employees can view their analyzed report. It gives all details about

employees.

Identify project scope

Any person like employee, supervisor, etc can view salary details. Authentication is provided using password and username of both employee and

supervisor.

Objectives:

To design a model for the Payroll Management system using UML and generate code using VB.

Infrastructure:s

1. Hardware Requirements :PC2. Software Requirements:

Platform: Windows xp/98/me Front end tool: Microsoft Visual Basic 6.0 Back end tool: Microsoft access

MODULES:

The modules of the project are Login Employee details Calculate Allowance

Page 85: Ooad Record

MODULE DELIVERABLES

Login:

Brief description:

The use case describes hoe a user logs into Payroll management system.

Flow of events:

1. Basic flow:

The use case sorts when the user wishes to log into the system.

The system request the actor to enter his/her name and password The actor enters name and password. The system validates the entered name and password and logs into

the system.

2. Alternate flow:

invalid name/password

If in the basic flow the actor enters the invalid name or password the system displays error message .The actor is providing with another chance to enter correct one or exit from the system

3. Special requirements:

None

4. Precondition:

The actor should select any category

5. Post condition:

If the use case was successful, the actor is now logged into the system. If not the system state is unchanged

Page 86: Ooad Record

Employee details:

Brief description

This use case allows the user to maintain employee information in the employee details and generate the report .This includes adding, searching, deleting employee detail from the system.

Add:

Flow of events:

1. Basic flow:

The use case adds when the user wishes to add the employee details in the database system.

The system request the actor to enter employee details The actor enters employee details The system validates will save the employee details into the

database system. If the user selects add function then add sub flow is executed

2. Alternate flow:

invalid data item

If in the basic flow the actor enters the invalid data item the system displays error message .The actor is providing with another chance to enter correct one or exit from the system

3. Special requirements:

None

4. Precondition:

Use case will connect to the entry form interface.

5. Post condition:

If the use case was successful, the actor is now adding the employee details into the database system. If not the system state is unchanged

Search:

Page 87: Ooad Record

Flow of events:

1. Basic flow

When the user wants to search particular record from system he can initialize search function.

If the user selects search function then search sub flow is executed.

2. Alternate flow:

invalid data item

If in the basic flow the actor enters the invalid data item the system displays error message .The actor is providing with another chance to enter correct one or exit from the system

3. Special requirements:

None

4. Precondition:

use case will connect to the search form interface.

5. Post condition:

If the use case was successful, then actor will search the particular record and display the employee details. If not, the system state is unchanged.

Delete:

Flow of events:

1. Basic flow

When the user wants to Delete particular record from system he can initialize Delete function.

If the user selects Delete function then delete sub flow is executed.

2. Alternate flow:

invalid data item

If in the basic flow the actor enters the invalid data item the system displays error message .The actor is providing with another chance to enter correct one or exit from the system.

3. Special requirements:

Page 88: Ooad Record

None

4. Precondition:

use case will connect to the delete form interface.

5. Post condition:

If the use case was successful, the actor is now delete the employee details and saves that into the database system. If not, the system state is unchanged.

Calculate Allowance:

Flow of events:

1. Basic flow

When the user wants to calculate allowance for particular record from system he can initialize Delete function.

If the user selects calculate allowance function then delete sub flow is executed.

2. Alternate flow:

There is no chance for error. The allowance is calculated for existing record only.

3. Special requirements:

None

4. Precondition:

use case will connect to the calculate allowance form interface.

5. Post condition:

If the use case was successful, the actor is now calculate allowance the employee details and saves that into the database system. If not, the system state is unchanged.

GENERATING USE CASE DIAGRAM ,CLASS DIAGRAM , STATE CHART DIAGRAM , ACTIVITY DIAGRAM USING RATIONAL ROSE

DESCRIPTION:

Page 89: Ooad Record

(vii) Use Case diagram:

It shows some of the use cases, actors in the Employee InformationSystem and the relationships between them.

Use case is a high level piece of functionality that the system will provide.An actor is anything or anyone that interacts with the system being built

(viii) Class diagram: A class is a set of objects that share a common structure and common behavior (the same attributes, operations, relationships and semantics). A class is an abstraction o real-world items. When these items exist in the real world, they are instances of the class and are referred to as objects The attribute and operation sections of the class box can be suppressed to reduce detail in an overview. Suppressing a section makes no statement absence of attributes or operations, but drawing an empty section explicitly states that there are no elements in that part.

(ix)State Transition Diagram & Activity Diagram:

A state transition diagram shows the life cycle of a single object from the time it is created until it is destroyed. These diagrams are a good way to model the dynamic behavior of a class.

In Rose, no source code is generated from a state transition diagram. These diagrams serve to document the dynamic behavior of a class so that developers and analysts well have a clear understanding of the behavior.

To create a state transition diagram:Right click the desired class in the browser.Select “open state diagram” from the pop up menu.

Adding states:

1. To add a state, select state from the tool box bar.2. Click on the state transition diagram where the state should

appear.

To add an activity:1. Select the detail lab.2. Right click on the actins box.3. Select “insert” from the pop up menu.4. Double click the new action. Enter the action in the actions field.5. In the when box, select “enter until exit” to make the new action an

activity.

USE CASE DIAGRAM

Page 90: Ooad Record

Update

Log on

Add items

Delete items

Search items

Calculate allowance

Manager

enter details

enter eid

enter eid

enter details

username&password

CLASS DIAGRAM

Page 91: Ooad Record

payroll system

Addenameeiddesignbasicpayaddressphonebloodgroup

add()

Deleteenameeiddesignbasicpayaddressphonebloodgroup

delete()

Searchenameeiddesignbasicpayaddressphonebloodgroup

search()

calculate allowanceHRATADMSAPF

Salary()

ACTIVITY DIAGRAM

Page 92: Ooad Record

payroll system

Enter kind

add emp Details Delete emp

DetailsSearch emp

DetailsCalculate allowance

View salary

Enter Details

Delete Details

Display Details

Provide error message

No

yes

yes

no

no

yes

eid found? eid found?eid found?

STATE CHART DIAGRAMS:

Add EmpDetails:

Page 93: Ooad Record

Checking

Rejected

Add to Database

/get eid

eid not Available

eid Present

Search EmpDetails:

Checking

Rejected

Display Details

/get eid

valid eid

invalid eid

Delete EmpDetails:

Checking

Rejected

Delete Details

/get eid

valid eid

invalid eid

GENERATING SEQUENCE DIAGRAM,COLLABORATION DIAGRAM,COMPONENT DIAGRAM ,DEPLOYMENT DIAGRAM USING RATIONAL ROSE

Page 94: Ooad Record

DESCRIPTION:

(i) Sequence Diagrams: They are ordered by time. They are useful if someone wants to review the

flow of logic through a scenario. Although collaboration diagrams include sequencing information, it is easier to see on a sequence diagram.

Creating a sequence diagram:

1.Right click the appropriate package/use case in the browser. 2.From the short cut menu,select new -> Sequence diagram.3.Name the new sequence diagram.

4.Double-click the new sequence diagram in the browser to open it.

To add an item to the sequence diagram: 1. Use the tool bar buttons to add objects and messages to the diagram.

To remove an item from the sequence diagram:

1. Select the item on the sequence diagram.2. Select Edit-> Delete from model (or) press ctrl+D.

(ii) Collaboration Diagram: Like sequence diagrams,collaboration diagrams are used to show the flow through a specific scenario of a use case. collaborations diagrams focus on more on the relationship between the objects, While sequence diagrams are ordered by time.

To create a new collaboration Diagram:

1. Right click the appropriate use case in the browser.2. From the short cut menu, select new->collaboration diagram.3. Name the new collaboration diagram.4. double click the new collaboration diagram in the browser to open it.

Deleting a collaboration diagram: 1. Right click the collaboration diagram in the browser. 2. Select delete from the short cut menu.

(iii) Component Diagram:

Page 95: Ooad Record

The component diagram is a uml diagram that displays the components in the system and dependencies between them. A component is a physical module of a code. Components can include both source code libraries and Runtime files.once the components are created, they are added to a component diagram and relationships are drawn between them.the only type of a relationship between components is a dependency.a dependency suggests that one component must be compiled before another.

To create a component diagram in the component view:

1. In the browser ,Right click the package to contain the component diagram.2. select new ->component diagram from the pop up menu.3. Enter the name of the new component diagram.

To delete a component diagram in the component view:

1.In the browser , Right click the component diagram.2. Select delete from the pop up menu.

iv)Deployment diagram:

A deployment diagram shows allow the modes on the network,the connections between them and the process that will run on each one.

Opening the deployment diagram:

1. To open the deployment diagram, double click the deployment view in the browser. 2 .Rose will open the deployment diagram for the model.

Adding processors:A processor is any machine that has a processing power.

To add a processor:

1. Select processor from the toolbox.2. click the deployment diagram to place the processor.3. enter the name of the processor.

To Delete a processor from the Model:

1. Select the processor on the deployment diagram.2. Select edit -> Delete from model or press ctrl+D.

Adding Devices:

A device is a machine or piece of hardware without processing power. Devices include items such as dumb terminals,printers and scanners.

To add a device:

1. Select device from the toolbox.

Page 96: Ooad Record

2. Click the deployment to place the device.3. Enter the name of the device.

To Delete a device from the model:

1. Select the device on the deployment diagram.2. Select Edit -> Delete from model or press ctrl + D.

Adding connections:

A connection is a physical link between two processors., two devices , or a processor and a device.

To add a connection:

1. Select connection from the toolbox.2. Click on the node to connect.3. Drag the connection link to another node.

To Delete a connection from the model:

1. Select the connection on the deployment diagram.2. Select edit -> Delete from model or press ctrl + d

SEQUENCE DIAGRAM

ADD RECORD SEQUENCE DIAGRAM

Page 97: Ooad Record

Manager System Database

1.Request to Add Record

2.Enter Details

3.Check eid Availability

4.Check Database

5.Return Status

6.Details Added

7.Terminate

SEARH RECORD SEQUENCE DIAGRAM:

Manager System Database

1: Request to Search

2: Enter eid

3: Check for eid availability

4: Check Database

5: Return Status

6: Display Details

7: Terminate

DELETE RECORD SEQUENCE DIAGRAM

Page 98: Ooad Record

Manager System Database

1: Request to Delete

2: Enter eid

3: Check for eid availability

4: Check Database

5: Return Status

6: Delete Details

7: Terminate

COLLABORATION DIAGRAM:

Page 99: Ooad Record

Collaboration Diagram for Add EmpDetails:

Manager System

Database

4: 4.Check Database

1: 1.Request to Add Record7: 7.Terminate

2: 2.Enter Details6: 6.Details Added

3: 3.Check eid Availability

5: 5.Return Status

Collaboration Diagram for search EmpDetails:

Manager System

Database

1: Request to Search

2: Enter eid

3: Check for eid availability4: Check Database

5: Return Status

6: Display Details

7: Terminate

Collaboration Diagram for delete EmpDetails:

Page 100: Ooad Record

Manager System

Database

1: Request to Delete

2: Enter eid

3: Check for eid availability4: Check Database

5: Return Status

6: Delete Details

7: Terminate

COMPONENT DIAGRAM:

Log on

Emp Details

Data Base

DEPLOYMENT DIAGRAM:

Page 101: Ooad Record

Add details Delete Details

Search Details

Allowance Details

manager

RATIONAL ROSE IMPLEMENTATION

Page 102: Ooad Record

PROCEDURE:

REVERSE ENGINEERING:

1. Select tools -> visual basic -> component assignment tool.2. Create new component by right click on visual basic.3. Right click on project1 properties and select project for which code should be

generated.4. Select tools -> visual basic -> update model from code.5. Select the check box for which code should be generated and click next.6. Click finish and save the model.

CODINGS:FORM 1: LOGIN

Private Sub Command1_Click()If (Text1.Text = "PAYROLL" And Text2.Text = "PAYROLL") Then Text1.Text = " " Text2.Text = " " MsgBox ("Login success") Form2.Show Else MsgBox ("Login failed") End IfEnd Sub

Private Sub Command2_Click()EndEnd Sub

FORM 2:EMPLOYEE DETAILSPrivate Sub Command1_Click()Data1.Recordset.AddNewMsgBox ("Enter the field required and click save")End Sub

Private Sub Command2_Click()MsgBox ("RECORD ADDED")Data1.Recordset.UpdateEnd Sub

Private Sub Command3_Click()Dim a, f As Integera = InputBox("ENTER THE EMPID TO DELETE")f = 0Data1.Recordset.MoveFirstDoIf (Data1.Recordset("EMPID") = Val(a)) Thenf = 1Data1.Recordset.Delete

Page 103: Ooad Record

MsgBox ("RECORD DELTED")Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command4_Click()Dim a, f As Integera = InputBox("ENTER THE EMPID TO SEARCH")f = 0Data1.Recordset.MoveFirstDoIf (Val(a) = Data1.Recordset("EMPID")) Thenf = 1Exit DoEnd IfData1.Recordset.MoveNextLoop Until (Data1.Recordset.EOF)If (f = 0) ThenMsgBox ("RECORD NOT FOUND")End IfEnd Sub

Private Sub Command5_Click()Form3.Text1.Text = Val((Text4.Text) * 0.05)Form3.Text2.Text = Val((Text4.Text) * 0.02)Form3.Text3.Text = Val((Text4.Text) * 0.02)Form3.Text4.Text = Val((Text4.Text) * 0.05)Form3.Text5.Text = Val(Text4.Text) + Val(Form3.Text1.Text) + Val(Form3.Text2.Text) + Val(Form3.Text3.Text) + Val(Form3.Text4.Text)Form3.ShowEnd Sub

Private Sub Command6_Click()Me.HideEnd Sub

FORM3:SALARYPrivate Sub Command1_Click()Me.HideEnd Sub

OUTPUT

Page 104: Ooad Record

Login form:

EMPLOYEE DETAILS:

Page 105: Ooad Record

ADD EMPLOYEE DETAILS

SAVE EMPLOYEE DETAILS

Page 106: Ooad Record

DELETE EMPLOYEE DETAILS

Page 107: Ooad Record

SEARCH EMPLOYEE DETAILS

Page 108: Ooad Record

ALLOWANCE CALCULATION

Page 109: Ooad Record
Page 110: Ooad Record

RESULT:

Thus the implementation of THE PAYROLL SYSTEM is developed using visual basic and output is tested using rational rose software.