You are on page 1of 12

INDIVIDUAL ASSIGNMENT

MODULE : PROGRAMMING CONCEPTS


IN C++

(CT025-3.5-2)

COURSEWORK TITLE : Take-Vehicle System

INTAKE : UC2F1408SE

STUDENT NAME : SREE PRAKASH A/L


BASKARAN

STUDENT ID : TP032890

DATE ASSIGNED : 30th April 2015


DATE COMPLETED : 2nd June 2015
Abstract

This document shows how the researcher reflects the design of the
implementation codes and the implementation details that utilises the
object-oriented programming concepts.
Table of Contents
Introduction................................................................................................................ 4
Assumptions............................................................................................................... 5
Design........................................................................................................................ 5
Usecase Diagram.................................................................................................... 5
Object Oriented Programming (Justification with sample)..........................................8
Class........................................................................................................................ 8
Object...................................................................................................................... 8
Overloading............................................................................................................. 8
Encapsulation.......................................................................................................... 9
File Stream (read/write)........................................................................................... 9
Setter...................................................................................................................... 9
Conclusion................................................................................................................ 10
References................................................................................................................ 11
Introduction

You are required to develop an application which will be used to keep track of all drivers and
vehicles in a company. The company has many drivers and many different types of vehicles such
as bike, car, bus, truck, etc. A vehicle may have a driver assigned to it or no driver assigned to it.
It is staffs responsibility to assign a vehicle for their drivers. Consider a driver is assigned to
handle maximum one or no vehicle at a time.

This is a description of Take-Vehicle , where any user of the system has its own username and
password. The company has 2 types of employees: staff and driver each with specific operations.
- Sample attributes are listed below:
Vehicle : Vehicle number, type, capacity, driver assigned
Driver: driver id, name, zipcode, contact number, vehicle assigned.
The system must be able to perform the following functions:
Staff operation:
1. Login/out and change password
2. Create/Delete drivers and vehicles.
3. Assign/Unassign a driver to/from a vehicle.
- Before assign a driver to a vehicle, the system checks the availability of driver and
display the current list of assigned vehicle.
4. List all drivers (all attributes must be shown)
5. List all vehicles (all attributes must be shown)
6. List all instances of a specified type of vehicle or particular driver (all attributes of the instance
must be shown)
7. Edit details of drivers and vehicles in which any attribute of data that user entered before can
be updated and changed.
Driver operation:
1.login/out ,and also change password.
2.Able to view and update their details.
3.Able to view assigned vehicle list.
Assumptions
The assumptions of Take-Vehicle System are:

1. There is an admin who can create other admin, staff and drivers.
2. All users know how to use the system.
3. All users know exactly what to fill in each input field.
4. All users avoid using incorrect inputs.
5. All users know their username and passwords.

Design
Usecase Diagram
Usecase Specifications
1) Login

Actors Staff, Driver


Use case name Login
Description For users to log in to the system using their username and password.
Precondition User has to open the application.
Postcondition User will be logged in to the system.
Main flow 1. System displays a login page.
2. User enters a correct username and password.
3. User gains access to system
4. System displays a menu based on user type (staff/driver).
Alternative path 2. -User enters the wrong username and/or password.
-Error message is shown to user.
-Use case resumes at step 1.
Exceptions -

2) Change password

Actor Staff, Driver


Use case name Change password
Description For users to change their current password into a new password.
Precondition User must be logged in to the system.
Postcondition Users password is changed.
Main flow 1. System displays a menu.
2. User selects Change password.
3. User is required to enter current password.
4. System will check if actual current password & the entered current
password match.
5. Actual current password & entered current password match.
6. User is required to enter new password twice.
7. System will check if 1st new password & 2nd new password match.
8. 1st new password & 2nd new password match.
9. Users password is changed.
Alternative path 3. -Actual current password & entered current password do not
match.
-Error message is shown to user.
-Use case resumes at step 1.
6. -1st new password & 2nd new password do not match.
-Error message is shown to user.
-Use case resumes at step 4.
Exceptions At any point of the main flow the user wishes to cancel the changing of
password, the user can select cancel and the use case resumes at step 1.
3) Logout
Actor Staff, Driver
Use case name Logout
Description For users to log out and exit the system.
Precondition User must be logged in to the system.
Postcondition User logs out of the system.
Main flow 1. System displays a menu.
2. User selects Log out.
3. System displays a message confirming users action to log out.
4. User confirms log out action.
5. User is logged out of the system.
Alternative path 4. -User does not confirm log out action.
-Use case resumes at step 1.
Exceptions -

4) Create Driver

Actor Staff
Use case name Create Driver
Description For staff users to create a new driver.
Precondition User must be logged in to the system.
Postcondition A new driver is created.
Main flow 1. System displays a menu.
2. User selects Create Driver.
3. User is required to enter the new driver details.
4. System checks if each field is filled properly.
5. Each field is filled properly.
6. System displays a message confirming users action to create new
driver.
7. User confirms create new driver action.
8. New driver is created.
Alternative path
Exceptions At any point of the main flow the user wishes to cancel the creation of
new driver, the user can select cancel and the use case resumes at step 1.
Object Oriented Programming (Justification with sample)
Class
A class is a group of objects of related type. Once a class is defined, any number of objects can be created
which belong to that class. An object can access any member of the class from any part of the program
depending on the access level.

Object
Objects are the basic run-time entities in an object-oriented system. Programming problem is analyzed in
terms of objects and nature of communication between them. When a program is executed, objects
interact with each other by sending messages. Different objects can also interact with each other without
knowing the details of their data or code. Given an example for the above class Booking.

Overloading

Overloaded functions must differ in function signature ie either number of parameters or type of
parameters should differ. In overriding, function signatures must be same.
Encapsulation
Encapsulation refers to the act of representing essential features without including the
background details or explanations. Classes use the concept of abstraction and are defined as a
list of abstract attributes. Storing data and functions in a single unit (class) is encapsulation. Data
cannot be accessible to the outside world and only those functions which are stored in the class
can access it.

File Stream (read/write)

Setter
Conclusion

In conclusion, the researcher did not achieve all the requirements. However the current code
implemented can prove that the researcher was close to finishing it and understand at least some
of the OO concepts he has learned.
References
Chirlian, Paul M. Programming In C++. Columbus, Ohio: Merrill Pub. Co., 1990. Print.

Dale, Nell B, Chip Weems, and Mark R Headington. Programming In C++. Sudbury, Mass.:
Jones and Bartlett, 1998. Print.

Dewhurst, Stephen C, and Kathy T Stark. Programming In C++. Englewood Cliffs, N.J.:
Prentice Hall, 1989. Print.

Ettinger, Jean. Programming In C++. London: M. Macmillan, 1994. Print.

Stroustrup, Bjarne. The C++ Programming Language. Reading, Mass.: Addison-Wesley, 1997.
Print.

You might also like