Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
12 views126 pages

Manual

The document outlines the development of various software systems including an online course reservation system, an e-ticketing system for railway reservations, and a recruitment system for managing employee details and payroll calculations. Each system is designed with specific functionalities such as course registration, ticket booking, and employee data management, utilizing Visual Basic for implementation and various diagrams for design representation. The document also includes coding examples and questions for viva examination related to software design and development concepts.

Uploaded by

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

Manual

The document outlines the development of various software systems including an online course reservation system, an e-ticketing system for railway reservations, and a recruitment system for managing employee details and payroll calculations. Each system is designed with specific functionalities such as course registration, ticket booking, and employee data management, utilizing Visual Basic for implementation and various diagrams for design representation. The document also includes coding examples and questions for viva examination related to software design and development concepts.

Uploaded by

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

Ex. No.

1 ONLINE COURSE RESERVATION


Date:

Problem Statement

As the head of information systems for a college, you are tasked with developing
a new student registration system. The college would like a new client-server system to
replace its much older system developed around main frame technology. The new system
will allow students to register for courses and view report cards from PCs attached to the
campus LAN. Professors will be able to access the system to sign up to teach courses as
well as record grades.
Students may request a course catalogue containing list of course offering for all
college. Information about each course, such as professor, department and prerequisites,
will be included to help students make informed decisions.
Once the registration process is completed for the student, the registration system
sends information to the billing system so that the student can be billed for the course.

USE CASE DIAGRAM-ADMINISTRATOR

1
USE CASE DIAGRAM-STUDENT

CLASS DIAGRAM

2
ACTIVITY DIAGRAM

3
SEQUENCE DIAGRAM

4
COMPONENT DIAGRAM

DEPLOYMENT DIAGRAM

5
STAT E CHART DIAGRAM

6
AFTER CODE GENERATION:

#ifndef ADMINISTRATOR_H_HEADER_INCLUDED_B57DCBB5
#define ADMINISTRATOR_H_HEADER_INCLUDED_B57DCBB5

//##ModelId=4A78FD620284
class ADMINISTRATOR : public DataBase
{
public:
//##ModelId=4A78FF110388
Course();

//##ModelId=4A78FF1801A4
Level checking();

//##ModelId=4A78FF210156
Login();
private:
//##ModelId=4A78FF2A02CE
Admin pass;
};
#endif /* ADMINISTRATOR_H_HEADER_INCLUDED_B57DCBB5 */

REVERSE ENGINEERING

#ifndef ADMINISTRATOR_H_HEADER_INCLUDED_B57DCBB5
#define ADMINISTRATOR_H_HEADER_INCLUDED_B57DCBB5
//##ModelId=4A78FD620284
class ADMINISTRATOR : public DataBase
{
public:
//##ModelId=4A78FF110388
Course();
//##ModelId=4A78FF1801A4
Level checking();

//##ModelId=4A78FF210156
Login();
private:
//##ModelId=4A78FF2A02CE
Admins pass;
};

#endif /* ADMINISTRATOR_H_HEADER_INCLUDED_B57DCBB5 */

7
IMPLEMENTAION USING VB AND MS ACCESS

Form 1:

Form 2:

8
Form 3:

CODING:

Dim db As New ADODB.Connection


Dim rs As New ADODB.Recordset

Private Sub Command1_Click()


Dim s As String
s = "insert into Table1 values('" + Text1.Text + "','" + Text2.Text + "','" + Combo1.Text +
"','" + Text4.Text + "','" + Text5.Text + "','" + Text6.Text + "')"
db.Execute (s)
MsgBox ("new record inserted")
Form3.Show
Form2.Hide
End Sub

Private Sub Command2_Click()


Form2.Hide
Form3.Show
End Sub

Private Sub Form_Load()

9
db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\
no_of_seats.mdb;Persist Security Info=False"
db.Open
End Sub

Form 4:

CODING:

Dim db As New ADODB.Connection


Dim rs As New ADODB.Recordset

Private Sub Command1_Click()


Dim s As String
s = "insert into Table1 values('" + Text1.Text + "','" + Text2.Text + "','" + Combo1.Text +
"','" + Text4.Text + "','" + Text5.Text + "','" + Text6.Text + "')"
db.Execute (s)
MsgBox ("new record inserted")
Form3.Show
Form2.Hide
End Sub

Private Sub Command2_Click()

10
Form2.Hide
Form3.Show
End Sub

Private Sub Form_Load()


db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\
no_of_seats.mdb;Persist Security Info=False"
db.Open
End Sub

Form 5:

11
CODING:

Dim db As New ADODB.Connection


Dim rs As New ADODB.Recordset

Private Sub Command1_Click()


Dim s As String
Dim k As Integer
Dim p As Integer
p = Text2.Text
k=0
s = "select name from Table1 where reg_no='" + Text3.Text + "'"
Set rs = db.Execute(s)
While Not rs.EOF And k = 0
If rs(0) = Text1.Text Then
MsgBox ("authorized")
k=1
Else
MsgBox ("not authorized")
rs.MoveNext
End If
Wend
If p > 50 Then
MsgBox ("ELIGIBLE")
Else
MsgBox ("Not ELIGIBLE")
End If
End Sub

Private Sub Command2_Click()


Dim p, l As Integer
Dim s As String
Dim str As String
Dim str1 As String
Dim s1 As String
s = " insert into table3 values('" + Text1.Text + "','" + Text3.Text + "','" + Text2.Text +
"','" + Combo4.Text + "','" + Combo1.Text + "','" + Combo2.Text + "')"
Set rs = db.Execute(s)
str = " select no_of_seats from table2 where colleges='" + Combo2.Text + "' and
branch='" + Combo4.Text + "'"
Set rs = db.Execute(str)
l = Val(rs(0))
p=l-1
s1 = p

12
str1 = "update table2 set no_of_seats='" + s1 + "' where colleges='" + Combo2.Text + "'
and branch='" + Combo4.Text + "'"
Set rs = db.Execute(str1)
MsgBox ("SUCCESSFULLY REGISTER")
Form3.Show
Form5.Hide
End Sub
Private Sub Command3_Click()
Form5.Hide
Form3.Show
End Sub

Private Sub Command4_Click()


Dim p As Integer
p = Text2.Text
If p > 50 Then
MsgBox ("ELIGIBLE")
Else
MsgBox ("Not ELIGIBLE")
End If
End Sub

Private Sub Form_Load()


db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\cseserver\
26csb\26cs134\no_of_seats.mdb;Persist Security Info=False"
db.Open
End Sub

Result
Thus the course registration system has been developed successfully using VB
and its output is verified.

VIVA QUESTION

1. What do you mean by analysis and design?


2. What are the steps involved in designing?
3. What are the main underlying concepts of object orientation?
4. What do u meant by “SBI” of an object?
5. Differentiate persistent & non-persistent objects?
6. What do you meant by active and passive objects?
7. What is meant by software development method?
8. What are models and Meta models?
9. What do you meant by static and dynamic modeling?
10. How to represent the interaction between the modeling elements?

13
Ex. No. 2 E- TICKETING
Date:

Problem Statement

Our project is carried out to develop software for online Railway Reservation
System. The software is coded in VB, which is the front end, and it has Back end, which
contains information about the reservation and the availability of seats in trains. It has
various options like reservation, cancellation and to view details about available seats.
Our project mainly simulates the role of a Railway ticket booking officer, in a
computerized way.
The reservation option enables a person to reserve for a ticket at their home itself.
All he/ she has to do is to just login and enter the required details. After this the
reservation database is updated with the person details, train name and also the source
and destination place.
The cancellation option enables the passenger to cancel the tickets that has been
already booked by him/her.
The availability option prompts the person to enter train number, train name and
date of travel. After this the availability database is accessed and available positions are
produced.

USE CASE DIAGRAM :-

14
CLASS DIAGRAM :-

15
INTERACTION DIAGRAM :-

16
ACTIVITY DIAGRAM :-

17
STATE CHART DIAGRAM :-

18
COMPONENT DIAGRAM :-

DEPLOYMENT DIAGRAM :-

19
FORWARD ENGINEERING :-

Passenger.h

#ifndef PASSENGER_H_HEADER_INCLUDED_B57D8580
#define PASSENGER_H_HEADER_INCLUDED_B57D8580
#include "cancellation.h"

//##ModelId=4A79064B0139
class passenger : public cancellation
{
public:
//##ModelId=4A79069002E0
booking ();

//##ModelId=4A79069901A8
cancellation();

private:
//##ModelId=4A7906AB038D
name;

//##ModelId=4A7906B20012
age;

//##ModelId=4A7906B60254
sex;

//##ModelId=4A7906BB011C
addres;

};

#endif /* PASSENGER_H_HEADER_INCLUDED_B57D8580 */

Passenger.cpp

#include "passenger.h"
//##ModelId=4A79069002E0
passenger::booking ()
{
}
//##ModelId=4A79069901A8
passenger::cancellation()
{
}

20
REVERSE ENGINEERING :-

#ifndef PASSENGER_H_HEADER_INCLUDED_B57D8580
#define PASSENGER_H_HEADER_INCLUDED_B57D8580
#include "cancellation.h"
//##ModelId=4A79064B0139
class passenger : public cancellation
{
public:
//##ModelId=4A79069002E0

booking_ticket();

//##ModelId=4A79069901A8
cancellation();
private:
//##ModelId=4A7906AB038D
name;
//##ModelId=4A7906B20012
age;
//##ModelId=4A7906B60254
sex;
//##ModelId=4A7906BB011C
addres;
};#endif /* PASSENGER_H_HEADER_INCLUDED_B57D8580 */

21
FORM DESIGN USING VISUAL BASIC

FORM 1

CODE:

Dim rs As New ADODB.Recordset


Dim db As New ADODB.Connection
Private Sub Command1_Click()
If rs.EOF Then
MsgBox "File Over"
End If
If Text1.Text = rs(0) And Text2.Text = rs(1) Then
Form2.Show
rs.MoveNext
Else
MsgBox "invalid User"
End If
End Sub
Private Sub Form_Load()
db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\Case Tools\
db1.mdb;Persist Security Info=False"
db.Open
Set rs = db.Execute("Select * from login")
End Sub

22
FORM 2:

CODE :

Dim rs As New ADODB.Recordset


Dim db As New ADODB.Connection

Private Sub Command1_Click()


Dim a As String
a = Calendar1.Value
Text1.Text = a
Form3.Show
End Sub

Private Sub Form_Load()


db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\db\
form6.mdb;Persist Security Info=False"
db.Open
End Sub

23
FORM 3:

CODE :

Dim db As New ADODB.Connection


Dim rs As New ADODB.Recordset

Private Sub Command1_Click()


Form4.Show
End Sub

Private Sub Command2_Click()


Form5.Show
End Sub

Private Sub Command3_Click()


Dim p, l As Integer
Dim s As String
Dim str As String
Dim str1 As String
Dim s1 As String
Dim w As String
w = Combo1.Text
If Combo1.Text = w Then
str = "select sleeper from passengerdet "
Set rs = db.Execute(str)

24
l = Val(rs(0))
p=l+1
s1 = p
str1 = "update passengerdet set sleeper='" + s1 + "' "
Set rs = db.Execute(str1)
End If
MsgBox "ticket has been cancelled"
End
End Sub
Private Sub Form_Load()
db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\db\
form6.mdb;Persist Security Info=False"
db.Open
End Sub

FORM 4 :

CODE :

Dim db As New ADODB.Connection


Dim rs As New ADODB.Recordset

Private Sub Command1_Click()


Dim s As String
s = "select sleeper from passengerdet "
Set rs = db.Execute(s)

25
Text1.Text = rs(0)
End Sub

Private Sub Command2_Click()


Form5.Show
Form4.Hide
End Sub

Private Sub Form_Load()


db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\db\
form6.mdb;Persist Security Info=False"
db.Open
End Sub

FORM 5 :

CODE :

Dim rs As New ADODB.Recordset


Dim db As New ADODB.Connection

Private Sub Command1_Click()


Dim p, l As Integer
Dim s As String
Dim str As String
Dim str1 As String
Dim s1 As String
Dim w As String
w = Combo2.Text
db.Execute ("insert into findingtrain(Source,Destination,Class,Name) values('" +
Form2.Combo1.Text + "' , '" + Form2.Combo2.Text + "' , '" + Form2.Combo3.Text + "' ,
'" + Text1.Text + "' )")
If Combo2.Text = w Then

26
str = "select sleeper from passengerdet "
Set rs = db.Execute(str)
l = Val(rs(0))
p=l-1
s1 = p
str1 = "update passengerdet set sleeper='" + s1 + "' "
Set rs = db.Execute(str1)
End If
Form6.Show
End Sub

Private Sub Form_Load()


db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\db\
form6.mdb;Persist Security Info=False"
db.Open
End Sub

FORM 6 :

CODE :

Private Sub Command1_Click()


MsgBox "You're Ticket Has Been Booked and You're Details are succesfully entered into
our database"
End
End Sub

Result
Thus the E- ticket reservation system for railway has been developed successfully
and its output is verified.

27
VIVA QUESTION
1. What are all the applications of E- Ticketing?
2. List the disadvantage of E- Ticketing application.
3. How to resolve many to many relationships?
4. How do you represent static members and abstract classes in Class Diagram?
5. Can we use UML for user interface (UI) design?
6. How to reverse engineer C++ code in UML?
7. How do you convert uses cases into test cases?
8. Difference: Object Oriented Analysis (OOA) and Object Oriented Design
(OOD)?
9. What are the tools you used for OOAD?
10. What are the four phases of the Unified Process?
11. What is association?
12. How to use CRC Cards for Class Design?

Ex. No. 3 RECRUITMENT SYSTEM


Date:

PROBLEM STATEMENT
Design a Recruitment System with all necessary details such as Employee
number, Employee name, his personal details and Designation, etc. where a operator can
select his Employee number and see the details of him. And also calculate Basic pay,
HRA, Allowance, etc, for salary details. The Employee Payroll System consist of details
of Employee who already working in the company or a newly employed person. The
details of newly employed person should be updated in the database.
This new software for payroll does various tasks to facilitate the companies recruitment
and payroll calculation. The various tasks done are:
1. To get the employee ID that is used for login purposes. This ID is verified for
authentication with the database and the employee is given the rights to login.
2. After logging in, the next task is to display all the details of the employee
displaying the details such as
i. Name.
ii. Designation
iii. Employee ID

28
3. The next task is to calculate the salary of the employee taking into account the
following details such as HRA, DA, TA, PF, LIC as follows
Gross Salary = (per day salary * worked days) + (HRA + DA +
TA)
4. The final task is to calculate the net salary by calculating the detection
Deduction = PF + LIC
Net Salary = Gross Salary – Deduction
5. The salary calculation differs for each employee depending upon his designation
and it should be mentioned by the employee while logging in the system.

USECASE DIAGRAM:

CLASS DIAGRAM:

29
30
ACTIVITY DIAGRAM:

31
SEQUENCE DIAGRAM:

32
COLLABORATION DIAGRAM:

STATECHART DIAGRAM:

33
DEPLOYMENT DIAGRAM:

CODING:
Form 1:
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "Please Enter Username"
Text1.SetFocus
ElseIf Text1.Text = "admin" And Text2.Text = "password" Then
Form1.Hide
Form2.Show
Form2.SetFocus
ElseIf Text1.Text = "employee" And Text2.Text = "password" Then
Form1.Hide
Form4.Show
Form4.SetFocus
Else

34
MsgBox "Invalid Username or Password... Try Again!!!"
Text1.SetFocus
SendKeys "{home}+{end}"
Text2.Text = ""
End If
End Sub

Private Sub Command2_Click()


End
End Sub

Form 2:
Private Sub Command1_Click()
Data1.Recordset.AddNew
Text1.SetFocus
End Sub

Private Sub Command10_Click()


End
End Sub

Private Sub Command2_Click()


Data1.Recordset.Edit
Text1.SetFocus
End Sub

Private Sub Command3_Click()


Data1.Recordset.Update
End Sub

Private Sub Command4_Click()

35
Data1.Recordset.MoveFirst
End Sub

Private Sub Command5_Click()


Data1.Recordset.MovePrevious
End Sub

Private Sub Command6_Click()


Data1.Recordset.MoveNext
End Sub

Private Sub Command7_Click()


Data1.Recordset.MoveLast
End Sub

Private Sub Command8_Click()


Form2.Hide
Form3.Show
End Sub

Private Sub Command9_Click()


Form2.Hide
Form1.Show
End Sub

Form 3:
Private Sub Command1_Click()
Data1.Recordset.Edit
Text1.SetFocus
End Sub

36
Private Sub Command10_Click()
End
End Sub

Private Sub Command2_Click()


Data1.Recordset.Update
End Sub

Private Sub Command3_Click()


Data1.Recordset.MoveFirst
End Sub

Private Sub Command4_Click()


Data1.Recordset.MovePrevious
End Sub

Private Sub Command5_Click()


Data1.Recordset.MoveNext
End Sub

Private Sub Command6_Click()


Data1.Recordset.MoveLast
End Sub

Private Sub Command7_Click()


Text7.Text = (Val(Text1.Text) * Val(Text2.Text)) + Val(Text3.Text) +
Val(Text4.Text)
Text8.Text = Val(Text5.Text) + Val(Text6.Text)
Text9.Text = Val(Text7.Text) - Val(Text8.Text)
End Sub

37
Private Sub Command8_Click()
Form3.Hide
Form2.Show
Form2.SetFocus
End Sub

Private Sub Command9_Click()


Form3.Hide
Form1.Show
Form1.SetFocus
End Sub

Form 4:
Private Sub Command1_Click()
Data1.Recordset.MoveFirst
End Sub

Private Sub Command2_Click()


Data1.Recordset.MovePrevious
End Sub

Private Sub Command3_Click()


Data1.Recordset.MoveNext
End Sub

Private Sub Command4_Click()


Data1.Recordset.MoveLast
End Sub

Private Sub Command5_Click()


Form4.Hide

38
Form1.Show
Form1.SetFocus
End Sub

Private Sub Command6_Click()


End
End Sub
OUTPUT:
Form 1:

Form 2:

39
Form 3:

Form 4:

40
RESULT
Thus the recruitment processing System in Visual Basic is successfully created,
executed and the output is verified.

VIVA QUESTION
1. What is meant by recruitment system?
2. What are all the main modules of this application?
3. Why generalization is very strong?
4. Differentiate Aggregation and containment?
5. Can link and Association applied interchangeably?
6. What is meant by “method-wars”?
7. Whether unified method and unified modeling language are same or different?

8. Who were the three famous amigos and what was their contribution to the object
community?
9. Differentiate the class representation of Booch, Rumbaugh and UML?
10. What do you mean by "Realization"?
11. What is a Persistent, Transient Object?

Ex. No. 4 EXAM REGISTRATION


Date:

Problem Statement
Design an automated exam registration System that contains a database that holds
five different questions with four options. The user has to select one option and 2points is
awarded on each correct answer. The Quiz comprises of five questions. Each question
contains four options of which one is correct. The user has to select one option and he/she
is awarded 2points on each correct answer.
Design a Login form to enter Username. Before entering the Quiz, an Instruction
form is shown to the user. If the user accepts the instruction, the Quiz Questions form is
shown. The user has to select one correct option out of the four options for each question
and click next. 2points are awarded on each correct answer given. After answering the
last question of the Quiz, the Score form is displayed.

41
Use – Case Diagrams:

System:

Select Questions

Evaluate

System

Verify User Login

Generate Report

Administrator:

Define Rules

Update Database
Administrator

Maintain Server

42
Participant:

Enter Details

Specify Field

Participant
Take the Test

Print Report

Class Diagram:
Admin User
name : String name : String
id : Integer id : Integer

update_db() register()
maintain() field()
test()
score()
0..*

Database Systm
field : String login : String
level : Integer password : String
1 1
question() verify()
validate() updatescore()
answer() 1 report()
1
score() time()
Exam
field : String
0..* level : Integer
no_qns : Integer

evaluate()
opname2()
opname3()

43
Sequence Diagram:

Participant : System : Database : Score : Systm


User Systm Database
Login & Password
Verify Login

Acknowledge
Display Instruction

Ask for Field

Provide Field
Retrieve Question

Provide Question
Give Answer
Validate Answer
Submit Score

Update Score

Provide Final Score


user details & score
Generate Report

44
State Chart Diagram:
Idle Start

entry/ User & System at Idle State entry/ Login & Password
exit/ Ask for Password exit/ Successful Login

Test

entry/ Take the Test


exit/ User terminates/finishes or time expires

Report Verify

entry/ Score Generated entry/ Completion of Test


exit/ Report Generated exit/ Verification Complete

45
Activity Diagram

Participant System Database

Registers

Gets Details and


Processes it

Stores in
Provides id and Database
Password

Choses Field
Processes it
Selects the
questions

Test and Set


Timer

User answers
the questions

Validation

Pass Fail

Request

Store in
Database

Generate
Report

User Recieves
Report

Logout

46
Component Diagram:
Server

User Database
Interface

Deployment Diagram:

Server

TCP/IP
TCP/IP
Client PC

Database

LPT1

Printer

47
Reverse Engineering

Admin User
name : String name : String
id : Integer id : Integer

update_db() register()
maintaindetails() field()
test()
score()
0..*

Database Systm
field : String login : String
level : Integer password : String
1 1
question() verify()
validate() updatescore()
answer() 1 report()
1
score() time()
Exam
field : String
0..* level : Integer
no_qns : Integer

evaluate()
opname2()
opname3()

Admin.cpp

#include "Admin.h"

//##ModelId=4A6FD3E501DC
Admin::update_db()
{
}
//##ModelId=4A6FD3F50298
Admin::maintain()
{
}
Admin.h

#ifndef ADMIN_H_HEADER_INCLUDED_B57DB81C
#define ADMIN_H_HEADER_INCLUDED_B57DB81C
//##ModelId=4A6FD38E023A
class Admin
{

48
public:
//##ModelId=4A6FD3E501DC
update_db();

//##ModelId=4A6FD3F50298
maintain();
private:
//##ModelId=4A6FD39D0269
String name;

//##ModelId=4A6FD3C80150
Integer id;

};

#endif /* ADMIN_H_HEADER_INCLUDED_B57DB81C */

Admin.h(Reverse Engineering)

#ifndef ADMIN_H_HEADER_INCLUDED_B57DB81C
#define ADMIN_H_HEADER_INCLUDED_B57DB81C

//##ModelId=4A6FD38E023A
class Admin
{
public:
//##ModelId=4A6FD3E501DC
update_db();

//##ModelId=4A6FD3F50298
maintaindetails();

private:
//##ModelId=4A6FD39D0269
String name;

//##ModelId=4A6FD3C80150
Integer id;

};

#endif /* ADMIN_H_HEADER_INCLUDED_B57DB81C */

49
Form 1:

Form 2:

50
Form 3:

Form 4:

51
Form 5:

52
Form 1:

Dim db As New ADODB.Connection


Dim rs As New ADODB.Recordset

Private Sub Command1_Click()


Form3.Show
End Sub

Private Sub Command2_Click()


db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Z:\quiz development\quiz.mdb;Persist Security
Info=False"
db.Open
Set rs = db.Execute("select * from users")
Dim i As Integer
Dim cnt As Integer
cnt = 0
rs.MoveFirst
Do While Not rs.EOF
If Text1.Text = rs(0) And Text2.Text = rs(1) Then
Form2.Show
db.Execute ("insert into score (username) values('" +
Text1.Text + "')")
db.Close
Unload Me
Exit Do
Else
cnt = cnt + 1
End If
rs.MoveNext
Loop
If cnt > 0 Then
MsgBox "Wrong username/password", vbDefaultButton1, "Login
Error"
End If
Text1.Text = ""
Text2.Text = ""
'db.Close
End Sub

Form 2:

Private Sub Check1_Click()


If Check1.Value = 1 Then
Command2.Enabled = True
End If

53
If Check1.Value = 0 Then
Command2.Enabled = False
End If
End Sub

Private Sub Command1_Click()


Form1.Show
Unload Me
End Sub

Private Sub Command2_Click()


Form4.Show
Unload Me
End Sub

Private Sub Form_Load()


Text1.Text = "1. The duration of test is 5 minutes."
End Sub

Form 3:

Dim db As New ADODB.Connection


Dim rs As New ADODB.Recordset

Private Sub Command1_Click()


db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Z:\quiz development\quiz.mdb;Persist Security
Info=False"
db.Open
Dim st As String
st = Combo1.Text + "/" + Combo2.Text + "/" + Combo3.Text
'MsgBox st
'MsgBox "insert into regdetails values('" + Text1.Text +
"','" + st + "','" + Text2.Text + "'," + Text3.Text + ",'" +
Text4.Text + "','" + Text5.Text + "')"
db.Execute ("insert into regdetails values('" + Text1.Text +
"','" + st + "','" + Text2.Text + "','" + Text3.Text + "','"
+ Text4.Text + "','" + Text5.Text + "')")
db.Execute ("insert into users values('" + Text6.Text +
"','" + Text7.Text + "')")
db.Execute ("insert into score (username) values('" +
Text6.Text + "')")
MsgBox "Successfully Enrolled.Moving Onto The Quiz World",
vbDefaultButton1, "Notification"
db.Close
Form4.Show

54
Unload Me
End Sub
Private Sub Command2_Click()
Form1.Show
Unload Me
End Sub
Private Sub Form_Load()
Dim i As Integer
Combo1.Clear
Combo2.Clear
For i = 1 To 31
Combo1.AddItem i
Next i
For i = 1 To 12
Combo2.AddItem i
Next i
For i = 1970 To DateTime.Year(DateTime.Date)
Combo3.AddItem i
Next i
End Sub

Form 4:
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim i As Integer
Dim s As String
Dim q(20) As String
Dim c1(20) As String
Dim c2(20) As String
Dim c3(20) As String
Dim c4(20) As String
Dim ans(20), mans(20) As String
Dim ch(20) As Integer
Dim j As Integer
Dim k As Integer
Dim cnt As Integer
Dim choice(5) As Boolean
Dim s1, m As Integer
Private Sub Command1_Click()
If Option1.Value = True Then
mans(j) = Option1.Caption
End If
If Option2.Value = True Then
mans(j) = Option2.Caption
End If
If Option3.Value = True Then
mans(j) = Option3.Caption

55
End If
If Option4.Value = True Then
mans(j) = Option4.Caption
End If
'MsgBox mans(j)
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
If Label2.Caption = 4 Then
cnt = 1
MsgBox cnt
End If
If j < 5 Then
j = j + 1
Command1.Visible = True
Label1.Caption = q(j)
Option1.Caption = c1(j)
Option2.Caption = c2(j)
Option3.Caption = c3(j)
Option4.Caption = c4(j)
k = k + 1
'MsgBox mans(j)
End If
If j = 4 Then
Command1.Visible = False
End If
If j > 0 Then
Command2.Visible = True
End If
Label2.Caption = j
End Sub
Private Sub Command2_Click()
'j = j - 1
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
k = k - 1
If Option1.Value = True Then
mans(k) = Option1.Caption
End If
If Option2.Value = True Then
mans(k) = Option2.Caption
End If
If Option3.Value = True Then
mans(k) = Option3.Caption

56
End If
If Option4.Value = True Then
mans(k) = Option4.Caption
End If
If k >= 0 Then
Command2.Visible = True
Label1.Caption = q(k)
Option1.Caption = c1(k)
Option2.Caption = c2(k)
Option3.Caption = c3(k)
Option4.Caption = c4(k)
j = j - 1
End If
If k = 0 Then
Command2.Visible = False
j = 0
End If
If j < 5 Then
Command1.Visible = True
End If
Label2.Caption = j
End Sub
Private Sub Command3_Click()
Dim u, score As Integer
score = 0
rs.Close
rs.Open
Set rs = db.Execute("select ans,chosen from question")
rs.MoveFirst
Do Until rs.EOF
If rs(0) = rs(1) Then
score = score + 1
db.Execute ("update question set chosen='nil' where
chosen='" + rs(1) + "'")
End If
rs.MoveNext
Loop
Dim scr As String
scr = score
db.Execute ("update score set score=" + scr)
db.Close
Command2.Visible = False
Form5.Show
Unload Me
End Sub
Private Sub Form_Load()

57
db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Z:\quiz development\quiz.mdb;Persist Security
Info=False"
db.Open
Set rs = db.Execute("select * from question")
i = 0
Do While Not rs.EOF
q(i) = rs(1)
c1(i) = rs(2)
c2(i) = rs(3)
c3(i) = rs(4)
c4(i) = rs(5)
ans(i) = rs(6)
rs.MoveNext
'MsgBox choice(i)
i = i + 1
Loop
Label1.Caption = q(0)
Option1.Caption = c1(0)
Option2.Caption = c2(0)
Option3.Caption = c3(0)
Option4.Caption = c4(0)
j = 0
Label2.Caption = j
k = 0
cnt = 0
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
m = 1
End Sub
Private Sub Option1_Click()
If Option1.Value = True Then
db.Execute ("update question set chosen='" + Option1.Caption
+ "' where ques='" + Label1.Caption + "'")
End If
End Sub
Private Sub Option2_Click()
If Option2.Value = True Then
db.Execute ("update question set chosen='" + Option2.Caption
+ "' where ques='" + Label1.Caption + "'")
End If
End Sub
Private Sub Option3_Click()
If Option3.Value = True Then

58
db.Execute ("update question set chosen='" + Option3.Caption
+ "' where ques='" + Label1.Caption + "'")
End If
End Sub
Private Sub Option4_Click()
If Option4.Value = True Then
db.Execute ("update question set chosen='" + Option4.Caption
+ "' where ques='" + Label1.Caption + "'")
End If
End Sub
Private Sub Timer1_Timer()
Label3.Caption = s1
s1 = s1 + 1
If Label3.Caption = "300" Then
Label4.Caption = m
m = m + 1
s1 = 0
End If
End Sub
Private Sub Timer2_Timer()
If Label4.Caption = "60" Then
Timer1.Enabled = False
Command3.Value = True
End If
End Sub

Form 5:
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset

Private Sub Command1_Click()


Timer1.Enabled = True
Animation1.Open ("Z:\quiz development\printer.avi")
Animation1.Play (3)
End Sub
Private Sub Form_Load()
db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Z:\quiz development\quiz.mdb;Persist Security
Info=False"
db.Open
'rs.Open
Dim user, sc As String
Set rs = db.Execute("select * from score")
If Not rs.EOF Then
user = rs(0)
sc = rs(1)
End If

59
'MsgBox sc
Set rs = db.Execute("select name,email from regdetails")
Label2.Caption = "UserID:" + user
Label1.Caption = "Name:" + rs(0)
Label3.Caption = "Score:" + sc
Dim p As Integer
p = (Val(sc) / 5) * 100
If p > 40 Then
Label4.Caption = "PASS"
Else
Label4.Caption = "FAIL"
End If
Label5.Caption = "Email ID:" + rs(1)
db.Execute ("delete * from score")
db.Close
End Sub
Private Sub Timer1_Timer()
Animation1.Visible = False
Timer1.Enabled = False
End Sub

RESULT:
Thus the exam registration System in Visual Basic is successfully created,
executed and the output is verified.
VIVA QUESTION
1. What is meant by exam registration system?
2. What are all the applications of this project?
3. How to Create a Domain Model — Three Steps
4. Define Conceptual Classes
5. What is meant by Attributes?
6. What is aggregation in UML?
7. What is meant by fork in activity diagram?
8. What are the three types of Stereotype Classes?
9. Define merge
10. ____________is a function with object scope.
11. When to Use: State Diagrams?
12. Does a class inherit the constructors of its super class?

Ex. No. 5 SOFTWARE PERSONAL MANAGEMENT SYSTEM

60
Date:

PROBLEM STATEMENT
Design a Student Mark Analyzing System with Total, Grade, and Result &
Percentage calculation. Each Student should have their own Register Number which is
unique. The Student Analysis System consists of the login form where either student or
staff can login. If logged in as staff, the form provides options for Student Details entry
such as Name, RegNo, Marks etc,. Else If logged in as student, the form displays
Student’s Mark Analysis with Total, Grade, Result and Percentage Calculated.
Design a Login form where either student or staff can login. The Student Details
form for staff login must provide options for Student Details entry. The Student Details
form for student login must contain all details of the student including total, grade, result
& percentage of each student.
Usecase Diagram

61
CLASS DIAGRAM:

ACTIVITY DIAGRAM:

62
SEQUENCE DIAGRAM:

63
STATECHART DIAGRAM:

DEPLOYMENT DIAGRAM:

64
CODING:
Form 1:
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "Please Enter UserName"
Text1.SetFocus
ElseIf Text1.Text = "student" And Text2.Text = "password" Then
Form1.Hide
Form3.Show
ElseIf Text1.Text = "staff" And Text2.Text = "password" Then
Form1.Hide
Form2.Show
Else
MsgBox "Invalid UserName or Password. Try Again."
Text2.Text = ""
Text1.SetFocus
SendKeys "{home}+{end}"
End If
End Sub

Private Sub Command2_Click()


End
End Sub

Form 2:
Private Sub Command1_Click()
Data1.Recordset.AddNew
Text1.SetFocus
End Sub

Private Sub Command10_Click()

65
If Val(Text3.Text) >= 50 And Val(Text4.Text) >= 50 And Val(Text5.Text) >= 50
Then
If Val(Text6.Text) / 3 >= 80 Then
Text7.Text = "A"
ElseIf Val(Text6.Text) / 3 >= 70 And Val(Text6.Text) / 3 < 80 Then
Text7.Text = "B"
ElseIf Val(Text6.Text) / 3 >= 60 And Val(Text6.Text) / 3 < 70 Then
Text7.Text = "C"
ElseIf Val(Text6.Text) / 3 >= 50 And Val(Text6.Text) / 3 < 60 Then
Text7.Text = "D"
Else
Text7.Text = "-"
End If
Else
Text7.Text = "-"
End If
End Sub

Private Sub Command11_Click()


If Val(Text3.Text) >= 50 And Val(Text4.Text) >= 50 And Val(Text5.Text) >= 50
Then
Text8.Text = "PASS"
Else
Text8.Text = "FAIL"
End If
End Sub

Private Sub Command12_Click()


Text9.Text = Val(Text6.Text) / 3
End Sub

66
Private Sub Command13_Click()
Text6.Text = Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text)
If Val(Text3.Text) >= 50 And Val(Text4.Text) >= 50 And Val(Text5.Text) >= 50
Then
If Val(Text6.Text) / 3 >= 80 Then
Text7.Text = "A"
ElseIf Val(Text6.Text) / 3 >= 70 And Val(Text6.Text) / 3 < 80 Then
Text7.Text = "B"
ElseIf Val(Text6.Text) / 3 >= 60 And Val(Text6.Text) / 3 < 70 Then
Text7.Text = "C"
ElseIf Val(Text6.Text) / 3 >= 50 And Val(Text6.Text) / 3 < 60 Then
Text7.Text = "D"
Else
Text7.Text = "-"
End If
Else
Text7.Text = "-"
End If
If Val(Text3.Text) >= 50 And Val(Text4.Text) >= 50 And Val(Text5.Text) >= 50
Then
Text8.Text = "PASS"
Else
Text8.Text = "FAIL"
End If
Text9.Text = Val(Text6.Text) / 3
End Sub

Private Sub Command14_Click()


End
End Sub

67
Private Sub Command15_Click()
Form2.Hide
Form1.Show
End Sub

Private Sub Command2_Click()


Data1.Recordset.Update
End Sub

Private Sub Command3_Click()


Data1.Recordset.Edit
End Sub

Private Sub Command4_Click()


Data1.Recordset.Delete
End Sub

Private Sub Command5_Click()


Data1.Recordset.MoveFirst
End Sub

Private Sub Command6_Click()


Data1.Recordset.MovePrevious
End Sub

Private Sub Command7_Click()


Data1.Recordset.MoveNext
End Sub
Private Sub Command8_Click()
Data1.Recordset.MoveLast
End Sub

68
Private Sub Command9_Click()
Text6.Text = Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text)
End Sub

Form 3:
Private Sub Command1_Click()
Data1.Recordset.MoveFirst
End Sub

Private Sub Command2_Click()


Data1.Recordset.MovePrevious
End Sub

Private Sub Command3_Click()


Data1.Recordset.MoveNext
End Sub

Private Sub Command4_Click()


Data1.Recordset.MoveLast
End Sub

Private Sub Command5_Click()


End
End Sub

Private Sub Command6_Click()


Form3.Hide
Form1.Show
End Sub

69
OUTPUT:
Form 1:

Form2:

70
Form 3:

RESULT:
Thus the Personal management System in Visual Basic is successfully created,
executed and the output is verified

VIVA QUESTION
1. What is meant by personal management system?
2. List the applications of this software project.
3. Difference between Attribute and Association.
4. What are associative classes?
5. Explain Class Diagram in Detail.
6. Difference: 'uses', 'extends', 'includes'
7. What is composition?
8. Define Domain Model
9. What is activity parameter?
10. Define Swim lane

71
EX. No. 6 STOCK MAINTENANCE SYSTEM
Date:

Problem Statement

To improve the operational efficiency of a mail order company, the chief


executive officer is interested in computerizing the company’s business process. The
major business activities of the company can be briefly described as follows.
The company aims to provide high quality mail order service to all registered
members of the company.
An individual or a company registers as a member by completing the registration
form and sending it to the customer service department.
At the beginning the system displays the order option window. The customer may
select an order from the list of orders present in the window. The customer service
department verifies the membership and forwards the order to the sales department. If the
order can be processed with existing stock, the sales department processes the order and
issue delivery note to the inventory department and the information about each order
present in the order details helps the trader to update the database.
Otherwise a sales department isseues the purchase order to the supplier. When all
items are available, the inventory department delivers the item to the member, and the
accounts deparment issues the invoice to the member.
On receiving the payment the accounting system is updated and the trading
manager closes the order. The customer can cancel the order at any time and the database
is updated. The customer details and the order details, which are placed, must be
prevented from unauthorized access.

72
Stock maintenance System
Use Case Diagram

73
Class Diagram:

74
Interaction Diagrams:

Sequence Diagram:

75
Collaboration Diagram:

76
State Chart Diagram:

77
Activity Diagram:

customer agent System Database

asks for product enter the


product item

check the items check the availability of


in the Database the items

valid

verifies the expiry reduces the


date of the product item count

zz
confirms the
purchase indicate to DB tat
prod is not valid

generates the
report

asks for bill

bills the
products

78
Component Diagram:

Deployment Diagram:

79
Forward Engineering:

Cash.h:
#ifndef CASH_H_HEADER_INCLUDED_B57DD185
#define CASH_H_HEADER_INCLUDED_B57DD185
//##ModelId=4A6FD6C500BA
class Cash
{
public:
//##ModelId=4A6FD6F903A6
amt();
private:
//##ModelId=4A6FD6E40304
Long amount;
};
#endif /* CASH_H_HEADER_INCLUDED_B57DD185 */

Cash.cpp:
#include "Cash.h"
//##ModelId=4A6FD6F903A6
Cash::amt()
{
}

FORM1

80
CODING:

Private Sub Command1_Click()


If (Text1.Text = "admin" And Text2.Text = "apu") Then
MsgBox ("login valid")
Form1.Visible = False
Form2.Show
Else
MsgBox ("invalid login")
End If
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
End Sub

FORM2

CODING:

Dim db1 As New ADODB.Connection


Dim rs As New ADODB.Recordset

81
Private Sub Combo1_Click()
Dim ItemName As String
Dim a As String
Dim ItemAmt As Long
ItemName = Combo1.Text
a = "select ItemAmt from db1 where ItemName='" + ItemName + "'"
Set rs = db1.Execute(a)
ItemAmt = rs(0)
Text1.Text = ItemAmt
End Sub

Private Sub Command1_Click()


Text2.Text = Val(Text2.Text) + Val(Text1.Text)
End Sub
Private Sub Command2_Click()
MsgBox ("are you sure you want to bill?")
Form2.Visible = False
Form3.Show
End Sub

Private Sub Form_Load()


db1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\ES\
db1.mdb;Persist Security Info=False"
db1.Open
End Sub

FORM3

82
CODING:

Private Sub Command1_Click()


Text3.Text = Text2.Text - Text1.Text
MsgBox ("billing done please wait")
Form3.Visible = False
Form2.Show
End Sub

Private Sub Form_Load()


Text1.Text = Form2.Text2.Text
End Sub

Result
Thus the software for stock maintenance system has been developed in VB and its
output is verified.

VIVA QUESTION

1. What are all the advantages and applications of stock maintenance


system?
2. The classes defined in other classes, including those defined in methods
are called____________?
3. Can method be overloaded based on different return type but same
argument type?
4. Describe some techniques for expressing business rules/constraints either
in UML or via other means.
5. Describe the use of UML stereotypes in one of your recent projects (you
used stereotypes to express what?). Feel free to include small example.
6. Describe useful application of an “extends” use case (in what situations
would you use an “extends” use case instead of any of the other kind of
use case relationships?)
7. Differentiate Aggregation and containment?
8. Differentiate between template class and class template.
9. Differentiate between the message and method.
10. Differentiate persistent & non-persistent objects?

83
Ex. No. 7 BOOK BANK
Date:

Problem Statement
Software is developed for Book bank management system coded in VB, which is
the front end, and it has a Microsoft Access database that is used as the back end, which
contains the information about the students and available books. It has various options
like issue, return, and to view details about available books. This project mainly simulates
the role of a librarian, in a computerized way.
The issue option enables a student to search for a book in an easier and efficient
manner. All he has to do is to just enter the required category and the author of the book.
Once the book is available the student is asked to enter his/her ID and the book is issued.
After this the student database is updated with the book ID and the status of the book is
changed to unavailable.
The view option enables the manager to view details about the available books
and to get the information about the students. By entering the students ID he can view the
list of books borrowed by the particular student.
The return option prompts the student to just enter his ID and books ID. After this
the student’s database is updated and the status of the book is changed as available.

84
Usecase Diagram

login

search a book

member
librarian

return a book

issue a book

Class Diagram

library incharge
user name
password
student
name login()
id update borrow()
year update return()
view book details()
borrow() view student details()
return()

has
maintains

books
id
name
author
status

status change()

85
Activity diagram
Borrow

accept student
details

enter book name


and author

check
no availability

yes

display book issue book and


not available update database

86
Return

accept
book ID

update
database

87
Sequence Diagram

user GUI librarian server database

request for book

prompts for students and book details

ask for details

give needed data

enter data

send data
search database

check availability

books found

update database

database updation report

book issued

88
Collaboration Diagram

4: give needed data


user librarian

3: ask for details


1: request for book 2: prompts for students and book details

12: book issued 5: enter data

GUI

8: check availability
6: send data 11: database updation report
7: search database
10: update database
server databas
e
9: books found

89
Component Diagram

system

user
database

login search return borrow

Deployment Diagram

application server database server

PC printer

90
Forward Engineering

#include "Admin.h"

//##ModelId=4A6FD3E501DC
Admin::update_db()
{
}

//##ModelId=4A6FD3F50298
Admin::maintain()
{
}

Admin.h

#ifndef ADMIN_H_HEADER_INCLUDED_B57DB81C
#define ADMIN_H_HEADER_INCLUDED_B57DB81C

//##ModelId=4A6FD38E023A
class Admin
{
public:
//##ModelId=4A6FD3E501DC
update_db();

//##ModelId=4A6FD3F50298
maintain();

private:
//##ModelId=4A6FD39D0269
String name;

//##ModelId=4A6FD3C80150
Integer id;

};

#endif /* ADMIN_H_HEADER_INCLUDED_B57DB81C */

Reverse Engineering

#ifndef ADMIN_H_HEADER_INCLUDED_B57DB81C
#define ADMIN_H_HEADER_INCLUDED_B57DB81C

91
//##ModelId=4A6FD38E023A
class Admin
{
public:
//##ModelId=4A6FD3E501DC
update_db();

//##ModelId=4A6FD3F50298
maintaindetails();

private:
//##ModelId=4A6FD39D0269
String name;

//##ModelId=4A6FD3C80150
Integer id;

};

#endif /* ADMIN_H_HEADER_INCLUDED_B57DB81C */

VB Coding

92
Form 1:

Dim db As New ADODB.Connection


Dim rs As New ADODB.Recordset

Private Sub Command1_Click()


Form3.Show
End Sub

Private Sub Command2_Click()


db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\quiz
development\quiz.mdb;Persist Security Info=False"
db.Open
Set rs = db.Execute("select * from users")
Dim i As Integer
Dim cnt As Integer
cnt = 0
rs.MoveFirst
Do While Not rs.EOF
If Text1.Text = rs(0) And Text2.Text = rs(1) Then
Form2.Show
db.Execute ("insert into score (username) values('" + Text1.Text + "')")
db.Close
Unload Me
Exit Do
Else
cnt = cnt + 1
End If
rs.MoveNext
Loop
If cnt > 0 Then
MsgBox "Wrong username/password", vbDefaultButton1, "Login Error"
End If
Text1.Text = ""
Text2.Text = ""
'db.Close
End Sub

93
Form 2:

Private Sub Check1_Click()


If Check1.Value = 1 Then
Command2.Enabled = True
End If
If Check1.Value = 0 Then
Command2.Enabled = False
End If
End Sub

Private Sub Command1_Click()


Form1.Show
Unload Me
End Sub

94
Private Sub Command2_Click()
Form4.Show
Unload Me
End Sub

Private Sub Form_Load()


Text1.Text = "1. The duration of test is 5 minutes."
End Sub

Form 3:

Dim db As New ADODB.Connection


Dim rs As New ADODB.Recordset

Private Sub Command1_Click()


db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\quiz
development\quiz.mdb;Persist Security Info=False"
db.Open
Dim st As String
st = Combo1.Text + "/" + Combo2.Text + "/" + Combo3.Text
'MsgBox st
'MsgBox "insert into regdetails values('" + Text1.Text + "','" + st + "','" + Text2.Text +
"'," + Text3.Text + ",'" + Text4.Text + "','" + Text5.Text + "')"
db.Execute ("insert into regdetails values('" + Text1.Text + "','" + st + "','" + Text2.Text +
"','" + Text3.Text + "','" + Text4.Text + "','" + Text5.Text + "')")
db.Execute ("insert into users values('" + Text6.Text + "','" + Text7.Text + "')")
db.Execute ("insert into score (username) values('" + Text6.Text + "')")
MsgBox "Successfully Enrolled.Moving Onto The Quiz World", vbDefaultButton1,
"Notification"
db.Close
Form4.Show
Unload Me
End Sub

Private Sub Command2_Click()


Form1.Show
Unload Me
End Sub

Private Sub Form_Load()


Dim i As Integer
Combo1.Clear
Combo2.Clear
For i = 1 To 31
Combo1.AddItem i
Next i

95
For i = 1 To 12
Combo2.AddItem i
Next i
For i = 1970 To DateTime.Year(DateTime.Date)
Combo3.AddItem i
Next i
End Sub

Form 4:

Dim db As New ADODB.Connection


Dim rs As New ADODB.Recordset
Dim i As Integer
Dim s As String
Dim q(20) As String
Dim c1(20) As String
Dim c2(20) As String
Dim c3(20) As String
Dim c4(20) As String
Dim ans(20), mans(20) As String
Dim ch(20) As Integer
Dim j As Integer
Dim k As Integer
Dim cnt As Integer
Dim choice(5) As Boolean
Dim s1, m As Integer

Private Sub Command1_Click()


If Option1.Value = True Then
mans(j) = Option1.Caption
End If
If Option2.Value = True Then
mans(j) = Option2.Caption
End If
If Option3.Value = True Then
mans(j) = Option3.Caption
End If
If Option4.Value = True Then
mans(j) = Option4.Caption
End If
'MsgBox mans(j)
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False

96
If Label2.Caption = 4 Then
cnt = 1
MsgBox cnt
End If
If j < 5 Then
j=j+1
Command1.Visible = True
Label1.Caption = q(j)
Option1.Caption = c1(j)
Option2.Caption = c2(j)
Option3.Caption = c3(j)
Option4.Caption = c4(j)
k=k+1
'MsgBox mans(j)
End If
If j = 4 Then
Command1.Visible = False
End If
If j > 0 Then
Command2.Visible = True
End If
Label2.Caption = j
End Sub

Private Sub Command2_Click()


'j = j - 1
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
k=k-1
If Option1.Value = True Then
mans(k) = Option1.Caption
End If
If Option2.Value = True Then
mans(k) = Option2.Caption
End If
If Option3.Value = True Then
mans(k) = Option3.Caption
End If
If Option4.Value = True Then
mans(k) = Option4.Caption
End If
If k >= 0 Then
Command2.Visible = True
Label1.Caption = q(k)

97
Option1.Caption = c1(k)
Option2.Caption = c2(k)
Option3.Caption = c3(k)
Option4.Caption = c4(k)
j=j-1
End If
If k = 0 Then
Command2.Visible = False
j=0
End If
If j < 5 Then
Command1.Visible = True
End If
Label2.Caption = j
End Sub

Private Sub Command3_Click()


Dim u, score As Integer
score = 0
rs.Close
rs.Open
Set rs = db.Execute("select ans,chosen from question")
rs.MoveFirst
Do Until rs.EOF
If rs(0) = rs(1) Then
score = score + 1
db.Execute ("update question set chosen='nil' where chosen='" + rs(1) + "'")
End If
rs.MoveNext
Loop
Dim scr As String
scr = score
db.Execute ("update score set score=" + scr)
db.Close
Command2.Visible = False
Form5.Show
Unload Me
End Sub

Private Sub Form_Load()


db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\quiz
development\quiz.mdb;Persist Security Info=False"
db.Open
Set rs = db.Execute("select * from question")
i=0
Do While Not rs.EOF

98
q(i) = rs(1)
c1(i) = rs(2)
c2(i) = rs(3)
c3(i) = rs(4)
c4(i) = rs(5)
ans(i) = rs(6)
rs.MoveNext
'MsgBox choice(i)
i=i+1
Loop
Label1.Caption = q(0)
Option1.Caption = c1(0)
Option2.Caption = c2(0)
Option3.Caption = c3(0)
Option4.Caption = c4(0)
j=0
Label2.Caption = j
k=0
cnt = 0
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
m=1
End Sub

Private Sub Option1_Click()


If Option1.Value = True Then
db.Execute ("update question set chosen='" + Option1.Caption + "' where ques='" +
Label1.Caption + "'")
End If
End Sub

Private Sub Option2_Click()


If Option2.Value = True Then
db.Execute ("update question set chosen='" + Option2.Caption + "' where ques='" +
Label1.Caption + "'")
End If
End Sub

Private Sub Option3_Click()


If Option3.Value = True Then
db.Execute ("update question set chosen='" + Option3.Caption + "' where ques='" +
Label1.Caption + "'")
End If
End Sub

99
Private Sub Option4_Click()
If Option4.Value = True Then
db.Execute ("update question set chosen='" + Option4.Caption + "' where ques='" +
Label1.Caption + "'")
End If
End Sub

Private Sub Timer1_Timer()


Label3.Caption = s1
s1 = s1 + 1
If Label3.Caption = "300" Then
Label4.Caption = m
m=m+1
s1 = 0
End If
End Sub

Private Sub Timer2_Timer()


If Label4.Caption = "60" Then
Timer1.Enabled = False
Command3.Value = True
End If
End Sub

Form 5:

Dim db As New ADODB.Connection


Dim rs As New ADODB.Recordset

Private Sub Command1_Click()


Timer1.Enabled = True
Animation1.Open ("Z:\quiz development\printer.avi")
Animation1.Play (3)
End Sub

Private Sub Form_Load()


db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\quiz
development\quiz.mdb;Persist Security Info=False"
db.Open
'rs.Open
Dim user, sc As String
Set rs = db.Execute("select * from score")
If Not rs.EOF Then
user = rs(0)
sc = rs(1)

100
End If
'MsgBox sc
Set rs = db.Execute("select name,email from regdetails")
Label2.Caption = "UserID:" + user
Label1.Caption = "Name:" + rs(0)
Label3.Caption = "Score:" + sc
Dim p As Integer
p = (Val(sc) / 5) * 100
If p > 40 Then
Label4.Caption = "PASS"
Else
Label4.Caption = "FAIL"
End If
Label5.Caption = "Email ID:" + rs(1)
db.Execute ("delete * from score")
db.Close
End Sub
Private Sub Timer1_Timer()
Animation1.Visible = False
Timer1.Enabled = False
End Sub

Result
Thus the application for book bank has been developed successfully and its output
is verified.

VIVA QUESTION
1. Explain about book bank application.
2. Explain the difference between composition and aggregation.
3. Explain the difference between design model and an implementation
model.
4. Explain the different relationship notations in UML that you have used
(e.g., generalization, association, and so on.)
5. If familiar with it, describe how you used any one of the “gang of four”
design patterns in recent model you produced.
6. If familiar with it, describe the “design by contract” approach.
7. If familiar with it, describe the concept of UML profile.
8. In RUP business modeling, what is the difference between Business Actor
and Business Worker?
9. In the past, have you ever traced design and/or implementation artifacts
back to the user requirements? If yes, how?
10. Is object persistence expressed in the analysis model, the design model or
both? Explain.

101
Ex. No. 8 CREDIT CARD SYSTEM
Date:

Problem Statement
Software is developed for credit card system coded in VB, which is the front end,
and it has a Microsoft Access database that is used as the back end, which contains the
information about the customer details and there account details. It has various options
like cash payment, amount balance books.
The buy option enables a customer to search for different things on internet easier
and efficient manner. All he has to do is to just enter the required category and the
amount transaction details. Once the item is available the customer is asked to enter
his/her account number and the item is issued.
The view option enables the customer to view details about the available balance
and to get the information about the transactions. By entering the account number he can
view the list of transaction details.

102
UseCase Diagram
Client

UseCase Diagram Administrator

103
UML Class Diagram

104
Interaction Diagram
Sequence Diagram

105
Interaction Diagram
Collaboration Diagram

106
State Chart Diagram

107
Activity Diagram

108
Component Diagram

Deployment Diagram

109
Forward Engineering
Class account.h
#ifndef ACCOUNT_H_HEADER_INCLUDED_B57DA438
#define ACCOUNT_H_HEADER_INCLUDED_B57DA438

//##ModelId=4A6FD5AE00FC
class Account
{
public:
//##ModelId=4A6FD786007F
deposit();

//##ModelId=4A6FD78700DD
withdraw();

private:
//##ModelId=4A6FD75901C7
Integer number;

//##ModelId=4A6FD75A0273
Currency balance;

};

#endif /* ACCOUNT_H_HEADER_INCLUDED_B57DA438 */

Class account.cpp
#include "Account.h"

//##ModelId=4A6FD786007F
Account::deposit()
{
}

//##ModelId=4A6FD78700DD
Account::withdraw()
{
}

Reverse Engineering
Class account.h
#ifndef ACCOUNT_H_HEADER_INCLUDED_B57DA438
#define ACCOUNT_H_HEADER_INCLUDED_B57DA438

110
//##ModelId=4A6FD5AE00FC
class Account
{
public:
//##ModelId=4A6FD786007F
depositcash();

//##ModelId=4A6FD78700DD
withdraw();

private:
//##ModelId=4A6FD75901C7
Integer number;

//##ModelId=4A6FD75A0273
Currency balance;

};
#endif /* ACCOUNT_H_HEADER_INCLUDED_B57DA438 */

111
112
113
114
115
116
117
Form 1
Private Sub Command1_Click()
Form1.Visible = False
Form2.Show
End Sub

Private Sub Command2_Click()


Form1.Visible = False
Form4.Show
End Sub

Private Sub Command3_Click()


Form1.Visible = False
End Sub

Form 2
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset

Private Sub Command1_Click()


Dim login As String
Dim password As String
Dim k As String
login = Text1.Text
k = "select password from table1 where login='" + login + "'"
Set rs = db.Execute(k)
password = rs(0)
If password = Text2.Text Then
Form2.Visible = False
Form3.Show
Else
MsgBox ("Invalid PIN!")
Text1.Text = ""
Text2.Text = ""
End If
End Sub

Private Sub Command2_Click()


Form2.Visible = False
Form1.Show
End Sub

Private Sub Form_Load()


db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\CASE tools
lab print out\case tools lab\Database1.db.mdb;Persist Security Info=False"

118
db.Open
End Sub

Form 3
Private Sub Command1_Click()
Form3.Visible = False
Form6.Show
End Sub

Private Sub Command2_Click()


Form3.Visible = False
Form7.Show
End Sub

Private Sub Command3_Click()


Form3.Visible = False
Form8.Show
End Sub

Private Sub Command4_Click()


Form3.Visible = False
Form9.Show
End Sub

Private Sub Command5_Click()


MsgBox ("Collect Card")
Form3.Visible = False
Form2.Text1.Text = ""
Form2.Text2.Text = ""
Form1.Show
End Sub

Form 4
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset

Private Sub Command1_Click()


Dim login As String
Dim password As String
Dim k As String
login = Text1.Text
k = "select password from table2 where login='" + login + "'"
Set rs = db.Execute(k)
password = rs(0)
If password = Text2.Text Then
Form4.Visible = False

119
Form5.Show
Else
MsgBox ("Invalid Login!")
Text1.Text = ""
Text2.Text = ""
End If
End Sub

Private Sub Command2_Click()


Form4.Visible = False
Form1.Show
End Sub

Private Sub Form_Load()


db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\CASE tools
lab print out\case tools lab\Database1.db.mdb;Persist Security Info=False"
db.Open
End Sub

Form 5
Private Sub Command1_Click()
Form5.Visible = False
Form11.Show
End Sub

Private Sub Command2_Click()


Form5.Visible = False
Form10.Show
End Sub

Private Sub Command3_Click()


Form5.Visible = False
Form12.Show
End Sub

Private Sub Command4_Click()


Form5.Visible = False
Form4.Text1.Text = ""
Form4.Text2.Text = ""
Form1.Show
End Sub

Form 6
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset

120
Private Sub Command1_Click()
Dim withdraw As Long
Dim k As String
Dim l As String
Dim balance As Long
Dim newbalance As Long
Dim newbalance1 As String
Dim login As String
login = Form2.Text1.Text
withdraw = Text1.Text
k = "select balance from table1 where login='" + login + "'"
Set rs = db.Execute(k)
balance = rs(0)
If balance > withdraw Then
newbalance = balance - withdraw
newbalance1 = newbalance
l = "update table1 set balance='" + newbalance1 + "' where login='" + login + "'"
Set rs = db.Execute(l)
Text2.Text = "Withdrawn Amount=Rs " & Text1.Text
Else
Text1.Text = ""
Text2.Text = ""
MsgBox ("Amount not Available!!!!")
End If
End Sub

Form 7
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Command1_Click()
Dim deposit As Long
Dim k As String
Dim l As String
Dim balance As Long
Dim newbalance As Long
Dim newbalance1 As String
Dim login As String
login = Form2.Text1.Text
deposit = Text1.Text
k = "select balance from table1 where login='" + login + "'"
Set rs = db.Execute(k)
balance = rs(0)
newbalance = balance + deposit
newbalance1 = newbalance
l = "update table1 set balance='" + newbalance1 + "' where login='" + login + "'"
Set rs = db.Execute(l)

121
Text2.Text = "The Deposited Amount=Rs " & Text1.Text
End Sub

Private Sub Command2_Click()


Text1.Text = ""
Text2.Text = ""
Form7.Visible = False
Form3.Show
End Sub

Private Sub Form_Load()


db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\CASE tools
lab print out\case tools lab\Database1.db.mdb;Persist Security Info=False"
db.Open
End Sub

Form 8
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Command1_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Form8.Visible = False
Form3.Show
End Sub

Private Sub Command2_Click()


Dim login As String
Dim password As String
Dim newpassword As String
Dim k As String
Dim l As String
login = Form2.Text1.Text
newpassword = Text2.Text
k = "select password from table1 where login='" + login + "'"
Set rs = db.Execute(k)
password = rs(0)
If password = Text1.Text And Text2.Text = Text3.Text Then
MsgBox (newpassword & " -Password Updated!!")
l = "update table1 set password='" + newpassword + "' where login='" + login + "'"
Else
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""

122
MsgBox ("Invalid!!")
End If
End Sub

Form 9
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset

Private Sub Command1_Click()


Text1.Text = ""
Form9.Visible = False
Form3.Show
End Sub

Private Sub Command2_Click()


Dim balance As Long
Dim k As String
Dim login As String
login = Form2.Text1.Text
k = "select balance from table1 where login='" + login + "'"
Set rs = db.Execute(k)
balance = rs(0)
Text1.Text = "Amount Available=Rs" & balance
End Sub

Private Sub Form_Load()


db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\CASE tools
lab print out\case tools lab\Database1.db.mdb;Persist Security Info=False"
db.Open
End Sub

Form 10
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset

Private Sub Command1_Click()


Text1.Text = ""
Form10.Visible = False
Form5.Show
End Sub

Private Sub Form_Load()


db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\CASE tools
lab print out\case tools lab\Database1.db.mdb;Persist Security Info=False"
db.Open
Dim k As String

123
Dim newbalance As Integer
Dim balance As Integer
k = "select balance from table1"
Set rs = db.Execute(k)
balance = rs(0)
Text1.Text = balance
End Sub

Form 11
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset

Private Sub Command1_Click()


Dim name As String
Dim login As String
Dim balance As String
Dim age As String
Dim address As String
Dim k As String
Dim l As String
Dim n As String
Dim a As String
name = Text1.Text
k = "select balance from table1 where name='" + name + "'"
l = "select age from table1 where name='" + name + "'"
n = "select login from table1 where name='" + name + "'"
a = "select address from table1 where name='" + name + "'"
Set rs = db.Execute(k)
balance = rs(0)
Set rs = db.Execute(l)
age = rs(0)
Set rs = db.Execute(n)
login = rs(0)
Set rs = db.Execute(a)
address = rs(0)
Text2.Text = login
Text3.Text = age
Text4.Text = "Rs " & balance
Text5.Text = address
End Sub

Private Sub Command2_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""

124
Text5.Text = ""
Form11.Visible = False
Form5.Show
End Sub

Private Sub Form_Load()


db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\CASE tools
lab print out\case tools lab\Database1.db.mdb;Persist Security Info=False"
db.Open
End Sub

Form 12
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset

Private Sub Command1_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Form12.Visible = False
Form5.Show
End Sub

Private Sub Form_Load()


db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\CASE tools
lab print out\case tools lab\Database1.db.mdb;Persist Security Info=False"
db.Open
Dim k As String
Dim l As String
Dim m As String
Dim details As String
Dim age As String
Dim address As String
k = "select login from table2"
Set rs = db.Execute(k)
details = rs(0)
Text1.Text = details
l = "select age from table2"
Set rs = db.Execute(l)
age = rs(0)
Text2.Text = age
m = "select address from table2"
Set rs = db.Execute(m)
address = rs(0)
Text3.Text = address
End Sub

125
Result
Thus the application for credit card system has been developed successfully and
its output is verified.

VIVA QUESTION
1. Do you feel UML (or other types of) models have any value once the
implementation code has been generated? Why?
2. Explain the difference between composition and aggregation.
3. Explain the difference between design model and an implementation
model.
4. Explain the different relationship notations in UML that you have used
(e.g., generalization, association, and so on.)
5. If familiar with it, describe how you used any one of the “gang of four”
design patterns in recent model you produced.
6. If familiar with it, describe the “design by contract” approach.
7. If familiar with it, describe the concept of UML profile.
8. In RUP business modeling, what is the difference between Business Actor
and Business Worker?
9. In the past, have you ever traced design and/or implementation artifacts
back to the user requirements? If yes, how?
10. Is object persistence expressed in the analysis model, the design model or
both? Explain.

126

You might also like