PCPP Nathan Individual Assignment
PCPP Nathan Individual Assignment
INDIVIDUAL ASSIGNMENT
INDIVIDUAL ASSIGNMENT
NAME
STUDENT ID
: TP026049
INTAKE CODE
: UC2F1404IT (FC)
SUBJECT
LECTURER
PROJECT TITLE
(BPAMS)
DATE COMPELETED : 13th FEBRUARY 2014
Table of Contents
1
CT025-3-2-PCPP
INDIVIDUAL ASSIGNMENT
Table of Contents.................................................................................................... 2
ACKNOWLEDGEMENTS.......................................................................................... 3
INTRODUCTION...................................................................................................... 4
CONTENTS............................................................................................................. 5
USE CASE DIAGRAM............................................................................................ 5
USE CASE SPECIFICATION................................................................................... 6
CLASS DIAGRAM............................................................................................... 10
SCREEN SHOTS.................................................................................................... 11
USER LOGIN...................................................................................................... 11
STAFF MAIN MENU............................................................................................ 11
ADD USER (STAFF)............................................................................................ 12
ADD APARTMENT (STAFF).................................................................................12
EDIT APARTMENT (STAFF)................................................................................. 13
OWNER MAIN MENU.......................................................................................... 14
VIEW MY APARTMENTS (OWNER)......................................................................14
VIEW PAYMENT COLLECTED (OWNER)..............................................................14
CUSTOMER MAIN MENU.................................................................................... 15
VIEW RENTAL APARTMENTS (CUSTOMER).........................................................15
VIEW MY BOOKINGS (CUSTOMER)....................................................................16
Object oriented concepts..................................................................................... 17
CONCLUSION....................................................................................................... 22
REFERENCES........................................................................................................ 23
ACKNOWLEDGEMENTS
2
CT025-3-2-PCPP
INDIVIDUAL ASSIGNMENT
I would like to express my deepest appreciation to all those who provided me the possibility
to complete this assignment. A special gratitude I give to my Lecturer Miss Saeedeh Alsadat
Tabatabaei, whose contribution in stimulating suggestions and encouragement helped me to
coordinate my assignment especially for teaching me this module in such a way that I were
able to learn this highly technical module very easily.
Finally, an honorable mention goes to my family and friends for their understandings and
supports me in completing this assignment. Without helps of the particular that mentioned
above, I could face many difficulties while doing this.
CT025-3-2-PCPP
INDIVIDUAL ASSIGNMENT
INTRODUCTION
This documentation gives an overview of BP Apartment Management System (BPAMS)
which has been developed in C++ programming language. In this system has been tried to
use object oriented concepts as much as possible such as inheritance, polymorphism, function
overloading and objects as well as classes. To make sure system working smoothly there has
been some validation apartment id, owner id and owner contact number and some more
functions such as menu and navigation through the system using Switch statement. The data
are stored in a file and each record is distinguished by apartment id which is considered
record number in the file. There is a use case diagram and a class diagram has been provided
to ensure deep understanding of the system and its sequence of functions.
CT025-3-2-PCPP
CONTENTS
USE CASE DIAGRAM
INDIVIDUAL ASSIGNMENT
CT025-3-2-PCPP
INDIVIDUAL ASSIGNMENT
Use case
Description
Actor
Pre-condition
Main Flow
Alternative Flow
Use case
Description
Actor
Pre-condition
Main Flow
Alternative Flow
Use case
Description
Actor
Pre-condition
Staff registration
Adds staff information according to their designation
staff
Staff personally have to be logged in to add staff.
1. User login provide user name and password to login to the
system.
2. Once inside main menu, user chooses User registration
3. At the user type chooses s.
4. All fields such as username, password, fullname has to be filled
up.
Record will not be saved until the user enter the logout option.
Owner registration
Adds owner to the system
staff
Admin has to be logged in to do owner registration
1. Once inside main menu, user chooses User registration
2. At the user type chooses o
3. All fields such as username, password, fullname, contact
number and address has to be filled up.
Record will not be saved until the user enter the logout option.
Main Flow
Alternative Flow
6
CT025-3-2-PCPP
INDIVIDUAL ASSIGNMENT
Use case
Description
Actor
Pre-condition
Main Flow
Alternative Flow
Use case
Description
Actor
Pre-condition
Main Flow
Alternative Flow
Use case
Description
Actor
Pre-condition
Main Flow
Alternative Flow
Change password
Allows the users to change their own password
Staff, Owner, Customer
All the user personally must be logged in the system.
1. Once inside login, user chooses change password option
2. User have to key in their new password.
Once key in the new password and press enter its will straight
away log out from the account
Apartment Booking
Allows the customer to choose the apartment
Customer
Customer personally must be logged in the system.
1. Once inside login, chooses view apartment option
2. Customer should enter y and then enter the apartment ID.
If customer wrongly enter the apartment ID, different apartment
will be booked.
CT025-3-2-PCPP
Use case
Description
Actor
Pre-condition
Main Flow
Alternative Flow
INDIVIDUAL ASSIGNMENT
Payment
Allows the customer to confirm the apartment payment method
Customer
Customer personally must be logged in the system.
1.Once inside login, chooses view booking option
2. Customer should enter y and then enter the apartment ID.
If customer wrongly enter the apartment ID, the payment will be
goes different apartment
CT025-3-2-PCPP
CLASS DIAGRAM
INDIVIDUAL ASSIGNMENT
CT025-3-2-PCPP
INDIVIDUAL ASSIGNMENT
SCREEN SHOTS
USER LOGIN
This figure shows the user login form. In order to enter the system, user are required to enter
their user name and their password which is already register by the staff before. This system
can be used by three person Staff, Owner and Customer.
The figure above displays the staff main menu of the system that comes alongside six
options. The first option is Change password for staff. Next in order to add user, the staff is
who the one in charge for user registration. Besides the staff can add, edit and view the
apartments details.
10
CT025-3-2-PCPP
INDIVIDUAL ASSIGNMENT
This figure shows the user registration. When the user enter this form, user have to select the
user type according to the options given such as s for staff, o for owner and c for
customer. Then, the user has to be filled up the fields given.
This is the form where the staff will add the apartment details. The apartment details can be
viewed by the customers and also the owners.
11
CT025-3-2-PCPP
INDIVIDUAL ASSIGNMENT
This is the form where the staff will edit the apartment details. The apartment details only can
be edited by the staff.
12
CT025-3-2-PCPP
INDIVIDUAL ASSIGNMENT
The figure above displays the owner main menu of the system that comes alongside four
options such as change password, view my apartment, view payment collected and logout.
List of apartment contains two types one is to be view by the owner and another one to be
viewed by the customers. This is to be viewed by the owner.
13
CT025-3-2-PCPP
INDIVIDUAL ASSIGNMENT
This figure shows the owner to know whether the rental payment is done or not by the
customer.
CUSTOMER MAIN MENU
The figure above displays the customer main menu of the system that comes alongside four
options such as change password, view rental apartment, view my bookings and logout.
14
CT025-3-2-PCPP
INDIVIDUAL ASSIGNMENT
The figure above displays the list of rental apartments with availability and also provide
booking option to the customer.
The figure above shows the bookings done by the customer and also option to proceed with
the payment.
15
CT025-3-2-PCPP
INDIVIDUAL ASSIGNMENT
16
CT025-3-2-PCPP
17
INDIVIDUAL ASSIGNMENT
CT025-3-2-PCPP
INDIVIDUAL ASSIGNMENT
Objects
Object has same relationship to class as variable has with the data type. Objects can be
defined in similarly way as structure is defined. The main objects in the BP Apartment
Management System including Login object user class object, staff class object, owner class
object and customer class object. The following code indicates the declaration of objects in
the BP Apartment Management System.
Encapsulation
18
CT025-3-2-PCPP
INDIVIDUAL ASSIGNMENT
Encapsulation is the method of combining the data and functions inside a class. This hides the
data from being accessed from outside a class directly, only through the functions inside the
class is able to access the information.
Constructor
Constructors are the special type of member function that initializes the object automatically
when it is created Compiler identifies that the given member function is a constructor by its
name and return type. Constructor has same name as that of class and it does not have any
return type.
Vector constructor
Vector destructor
19
CT025-3-2-PCPP
INDIVIDUAL ASSIGNMENT
Multiple Inheritances
Multiple inheritance can be a controversial topic. Its an important feature in C++ and C++
programmers think of it as a very good structuring tool.
Ifstream
Ofstream
20
CT025-3-2-PCPP
INDIVIDUAL ASSIGNMENT
CONCLUSION
This assignment main purpose is to develop an application for them to manage the
apartments, bookings and rentals. There are 3 users of this system, namely the staff from
BackPacker Kelab Sdn Bhd, the owners of the apartment and the customers.
Besides that, this system also helps BackPacker staffs to update the status of apartment
payment. This BP Apartment Management System will be very useful for the user because it
helps the staff and to manage all records in the system, and helps the users to manage the
booking process easier with different level of user access.
In implementation users has much flexibility to run this program because every user has
different access control to perform selected feature in the system. Moreover this task had
leaded me to learn about the object oriented programming concept is such as classes and
objects, inheritance, and using files to store data in java programming. At this juncture, we
should like to seize this opportunity once more to thank our address Lecturer Miss Saeedeh
Alsadat Tabatabaei for providing us a chance to discover the globe of software design and
requesting the vision that we have obtained across address sessions in this assignment.
21
CT025-3-2-PCPP
INDIVIDUAL ASSIGNMENT
REFERENCES
Bolton, D. (2015). Encapsulation Examples in C+. [online] About.com Tech. Available at:
http://cplus.about.com/od/glossar1/g/encapsulation.htm [Accessed 12 Feb. 2015].
C++, U. (2015). Use of constructor in C++. [online] Stackoverflow.com. Available at:
http://stackoverflow.com/questions/6574825/use-of-constructor-in-c [Accessed 12 Feb.
2015].
Cprogramming.com, (2015). Constructors and Destructors in C++ - Cprogramming.com.
[online] Available at:
http://www.cprogramming.com/tutorial/constructor_destructor_ordering.html [Accessed
12 Feb. 2015].
Cs.mun.ca, (2015). Data Encapsulation. [online] Available at:
http://www.cs.mun.ca/~donald/bsc/node13.html [Accessed 12 Feb. 2015].
Hscripts.com, (2015). Encapsulation - Data Abstraction - C++ OOPs concept Tutorial.
[online] Available at: https://www.hscripts.com/tutorials/cpp/cpp-encapsulation.php
[Accessed 12 Feb. 2015].
Programiz.com, (2015). C++ Constructors - C++ Tutorial. [online] Available at:
http://www.programiz.com/cpp-programming/constructors [Accessed 12 Feb. 2015].
Programiz.com, (2015). C++ Object and Class - C++ Tutorial. [online] Available at:
http://www.programiz.com/cpp-programming/object-class [Accessed 12 Feb. 2015].
Studytonight.com, (2015). Constructors and Destructors in C++. [online] Available at:
http://www.studytonight.com/cpp/constructors-and-destructors-in-cpp [Accessed 12
Feb. 2015].
22