Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

lOMoARcPSD|8934162

JAVA Assignment

Information Technology (Tribhuvan Vishwavidalaya)

StuDocu is not sponsored or endorsed by any college or university


Downloaded by james smith (smthjames786@gmail.com)
lOMoARcPSD|8934162

INDIVIDUAL ASSIGNMENT

TECHNOLOGY PARK MALAYSIA

CT038-3.5-2-OODJ
OBJECTED-ORIENTED DEVELOPMENT WITH JAVA

NP2F1809IT

HAND OUT DATE: 6 DECEMBER 2018

HAND IN DATE: 12 FEBUARY 2019

WEIGHTAGE: 50%

SUBMITTED BY: ROLL NO:

Anish Mandal NP000147

___________________________________________________________________________

INSTRUCTIONS TO CANDIDATES:

1. Submit your assignment at the administrative counter.

2. Students are advised to underpin their answers with the use of references (Cited
using the Harvard Name System of referencing).

3. Late submissions will be awarded zero (0) unless extenuating Circumstances


(EC) are upheld.

4. Cases of plagiarism will be penalized.

5. The assignment should be bound in an appropriate style (comb bound or


stapled)

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

6. Where the assignment should be submitted in both hard copy and softcopy, the
softcopy of the written assignment and source code (where appropriate) should
be on a CD in an envelope/ CD cover and attached to the hardcopy.

7. You must obtain 50% overall to pass this module

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

Acknowledgement

I would like to express my deepest appreciation to entire individuals who provided me the
possibility to complete this report. A special gratitude I would like to give to our subject teacher
Mr. Aryan Thakur, whose contribution in stimulating suggestions and encouragement, helped
us to coordinate our assignment especially in solving the problems related to assignment that I
had trouble with.

Furthermore, I would also like to express our deepest thanks to Asian Pacific University (APU)
and Lord Buddha Education Foundation (LBEF) for providing us the opportunity to explore
and understand about importance of Object Oriented Programming which is also the great sector
for IT students. I’m also highly indebted to my classmates for their guidance and constant
supervision as well as for providing necessary information regarding the assignment and also for
their support to complete the assignment on time.

Sincerely,
Anish Mandal

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

Executive Summary
The whole assignment is about the Online Shopping Management System using the Object
Oriented Programming i.e. Java. Object-oriented programming (OOP) is a programming
language model organized around objects rather than "actions" and data rather than logic.
Historically, a program has been viewed as a logical procedure that takes input data, processes it,
and produces output data.
The Online Shopping Management system is an online application for an organization. It has
been developed on java. It is a virtual showcase for managing different types of product,
customer & registration, indent report and payment. The project Online Shopping Management
will reduce the amount of time spent by the employees of the company and also provides a
convenient and efficient means of reaching to person using cutting-edge-technologies. The main
goal is targeting towards the smooth internal communication and functioning for the customers
along with other useful information. Normally the project has been developed and graphical tools
have been fully integrated.

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

Abstract
Customers are getting involved in online shopping is only because of internet and awareness
among them. It relieves you from visiting shops build with bricks and mortar within your limited
time and free you to do some marketing even in bad weather condition. Online Shopping
System is one such platform that offers you to have some online shopping within your budgets.
To make this web site more flexible, maintainable and attractive, admin will be provided with
powerful tools to carry out their operations while customers will be provided with infinite
options apart from privacy and security. With just few clicks on simple buttons, you can purchase
at your comfort and freedom to know prices, reviews with availability of 24×7 for this online
shop.

Table of Content

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

1 Introduction..............................................................................................................................4

2 Objective..................................................................................................................................4

3 Scope........................................................................................................................................5

4 Limitations................................................................................................................................5

5 Problem Definition...................................................................................................................5

6 System Design..........................................................................................................................6

6.1 Feasibility Study...............................................................................................................6

7 Concepts and Techniques.........................................................................................................7

8 Conclusion..............................................................................................................................11

9 Reference................................................................................................................................12

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

1 Introduction

Java is a programming language and computing platform first released by Sun Microsystems in
1995. There are lots of applications and websites that will not work unless you have Java
installed, and more are created every day. Java is fast, secure, and reliable. From laptops to
datacenters, game consoles to scientific supercomputers, cell phones to the Internet, Java is
everywhere.

When a programmer writes a Java application, the compiled code (known as byte code) runs on
most operating systems (OS), including Windows, Linux and Mac OS. Java derives much of its
syntax from the C and C++ programming languages.

The project Online Shopping Management system has been fully developed using the concept of
OOP using the java language. The system is capable of maintaining details of various customers,
vendors, Products and storing all the day to day transactions such as generation of shipment
address bills, handling customers and product receipts, updating of stores. The product details
have been made clear and each product has its own unique identifier number, so that there exist
no confusion and error in delivering the product that customer has arrived. Admin can fully
manage the customer account as well as product details. Admin can whether delete the product if
it is out of stock and add product details if new product has been brought to inventory. Admin
can also delete and add user as per requirement.

Page | 1

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

2 Proposed System

Online Shopping System not only get popularity just by providing better products and services to
their customers but also the back end processing which were involved to achieve profitability.
This Online Shopping System will not only provide its customers to get products list with prices
but also flexibility to make comparison of prices and quantity offered by other vendors.
Customers were provided with privacy and security while purchasing and browsing products and
method to have a secure payment mechanism. It’s different search options will have their
customers to refine their requirements and get their desired products within requested price, if
available.

2.1 Modules

1. Admin Module
2. Manager Module
3. Customer Module

Admin Module:-

Admin will not only able to manage services which are being provided to their customers but
also able to add menus with products, initiate offers message to their customers inbox, set layout
and themes. Apart from these, it will also able to get their customers details, payment status, and
total-amount and manage account of working employees.

Manager module:-

Manager module is designed in order to manage the products and orders made by the customer to
ensure that all the detailed information related to product and order is handled correctly and
deliver the right product to the right customer. They also make the bills description to provide to
the customer.

Page | 2

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

Customer Module:-

To have privacy and security, each customers should have an account to access, search and
purchase products offered by this merchant website. Apart from they can also check their
delivery status and product review along with comparison options. Through various available
search options, customers can get their products of their choice.

3 Objective

The main objective of this assignment is as follows:

1. To fully understand and learn about Object Oriented Programming (OOP)


2. To implement the OOP in the Online Shopping Management system
3. To learn about java programming language
4. Develop error free and fully functional Online Shopping Management System using java
language.

4 Scope

The Online Shopping is the trend going on right now. But there are no well managed and user
friendly Online Shopping Management System. Therefore, the Online Shopping Management
System that I have made can be used by most of the organization that is planning to run their
business online. It can be used in every small as well as big organization because of the well
managed database system. This Online Shopping Management system has the ability to set
unique number for each product, making the identifying the product process easy and it reduces
the chances of delivering wrong product to the customer. Hence, the scope of this Online
Shopping Management System is very wide.

Page | 3

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

5 Limitations

The Online Shopping Management has many advantages right now. However, there are can be
some limitations since it is the online system. Some of them are as follow:

1. Fast Internet Access is required all the time


2. Because it runs on internet security can be a issue.
3. Update is required regularly

6 Problem Definition

To develop a web-based application to improve the service to the customers and merchant, that
will help increase the sales and profit in Online Shopping.

Page | 4

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

7 System Design

7.1 Use Case Diagram

Figure 1: Use Case Diagram of Admin


The above figure shows the use case diagram of Admin. Admin can add, edit, view, delete and
search both customer and manager account. Overall the Admin can perform all the task required
as per time and inconvenience.

Page | 5

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

Figure 2: Use-case Diagram of Manager


This is the use-case diagram of Manager. Manager handles the activity related to product and
order. They can add, delete , view, search modify the product and order details as per
requirement and time.

Figure 3: Use-case diagram of Customer

Page | 6

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

The customer can buy and search product and add the item they like to their cart and make
further decision later on if they really want to buy the product. After the order can been
confirmed they will get the bill details.

Page | 7

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

7.2 Activity Diagram

Figure 4: Activity Diagram of Online Shopping Management System


This is the activity diagram showing the whole system procedure of Online Shopping
Management System. System users has to login to the system using valid username and
password. Depending on their categories i.e. Admin, Manager, and Customer, they will be
assigned to their respective pages and use the system.

Page | 8

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

7.3 Class Diagram

Figure 5: Class Diagram of Online Shopping Management System


This is the simple class diagram of our system. In this class diagram some of the attributes and
methods and class have been shown which has been in our code. All the attributes has not been
listed here.

Page | 9

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

8 Implementation of Program Documentation

8.1 Inheritance

Inheritance provides a solution that allows subclass or child class to access instance’s variable or
method of its parent class or super class provided that variables are not with privately stated. For
example, a car inherits a method called “starting engine” from Vehicle class since vehicle is
common to have start engine function. This helps in a better data analysis, accurate coding and
reduces development time.

Figure 6: Inheritance
From the above code, AddAccountFrame class will be inherited from the RegisterForm class
whereby the AddAccountFrame class is a child class. To be able to do this, the reserved keyword
‘extends’ is declared as the AddAccountFrame class. AddAccountFrame class has privilege
access to parent’s class variables as well as its method provided reserved keyword ‘super’ is
used.

Page | 10

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

8.2 Encapsulation

Encapsulation refers a technique that combining data and method into single entity in such a way
that also promotes data hiding that keep unnecessary attributes hidden from other classes. As
contrast to structured programming in which data is treated as global data in which variable can
be accessed directly. Encapsulation on objects allows unnecessary data to be hidden easily
without being further modification. This can be done by setting up access method known as
PRIVATE indicates the variable has only local access that cannot be used by other classes

Figure 7: Encapsulation
From the code shown above, all the variables has been declared with “private” access method
which promotes encapsulation that hide all the data from being modified by non-relevant objects,
as opposed to structured programming in that data will act as global data without any privilege
access method to control the access. Furthermore, in order for above variables to be accessed,
mutator and accessor method have to be implemented:

Page | 11

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

Figure 8: Encapsulation - getter and setter


From the above code shown, accessor method is used as get method to get value of variable and
pass it to those who call this method whereas mutator is used as set method in that change the
value of variable implicitly provided the class knows this method name, otherwise, the class will
get error “the variable is privately protected”.

Page | 12

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

8.3 Polymorphism

It is an ability that allows a function to be used in many forms to serve different purposes at
particular time. This provides greater extensibility in which user need not declare new form of
method to solve single function.

Figure 9: Polymorphism
The above code shows overloading polymorphism since the same method name has been used
but with different number of parameters.

Page | 13

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

8.4 Exception Handling

Exception Handling is the procedure of responding to the occurrence, across computation of


exceptions that frequently change the normal of plan execution. It is very important for the
performance of any system because it helps to avoid crashes.

Figure 10: Exceptional Handling


The above code shows that IOException which will display message if there if error while
reading the file.

Page | 14

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

9 Sample Output with Explanation

Figure 11: Login Form


This is the sample output of Login form where user should enter their valid username and
password. Depending on the user category i.e. Admin, Manager and Customer, it will redirect
users to their respective page. They cannot login to the System if username and password is
wrong.

Page | 15

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

Figure 12: Registration Form


This is the registration form where user can register their id and use the system. They need to fill
all the fields properly and should have unique else it will show the error message saying Member
already exist.

Page | 16

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

Figure 13: Admin Panel


This is admin panel where admin manages account for both customer and manager. Admin adds,
delete, view, search, and modify user account of both customer and users.

Page | 17

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

Figure 14: Admin Task


The above figure shows the function of admin. Admin can add, view, delete, search, and modify
both managers and customers account.

Page | 18

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

Figure 15: Admin Registration Function


This is the registration function performed by Admin, where admin can register id for both
manager and customer.

Page | 19

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

Figure 16: Customer Panel


The above figure shows the Customer panel, where customer has the option to search product
and add product to cart. And in the cart customer can get the product details, order details and
bill information.

Page | 20

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

Figure 17: Manager Panel


The above figure shows the Manager Panel where manager can manages all the product and
order details. They can add product to the inventory or delete the product if it is out of stock in
Inventory.

Page | 21

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

Figure 18: Product Information


This is product information page where user can get all the detailed information about the
product and add them to cart. It also shows how many product are still in stock.

Page | 22

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

Figure 19: Product List


This is the product list pages for mobile item. More pages are there for other categories like kid’s
item, men’s category and women’s category. This shows the small detail about the product and
when they click in the image it will show whether item is in stock.

Page | 23

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

Figure 20: Delivery Confirmation


This is the final page for product ordering procedure which asks for delivery address. After
giving the valid address they should finalize button and the item will be delivered on their door,
they can cancel the order by clicking close button.

Figure 21: Order Confirmed


This shows that the customer has given the address and order is finalized and item will be
delivered soon.

Page | 24

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

Figure 22: Bill Display


This is billing section viewed by customer. They can finalize their product by clicking on Buy
button. After this address will be asked and product order will be finalized.

Page | 25

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

8 Conclusion

From the assignment report, we can conclude that java is still the most important and advanced
OOP language to develop the system app. The demand of Online Shopping Management System
is very high in the market. However, the supply of the Online Shopping Management was not
sufficient and the existing system had many fault and errors with no database system to keep
managed record and was not secured. The Object Oriented Programming is a very powerful
technique to develop the secured, advanced and fully functional system.

Page | 26

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

10 Reference

Anon., 2016. JAVA. [Online]


Available at: https://docs.oracle.com/javase/7/docs/api/
[Accessed 1 february 2019].

Anon., 2017. freeProjects. [Online]


Available at: https://www.freeprojectz.com/java-projects-projects/java-project-online-shopping-
management-system
[Accessed 20 January 2018].

Anon., 2017. Geeks For Geeks. [Online]


Available at: https://www.geeksforgeeks.org/file-handling-java-using-filewriter-filereader/
[Accessed 16 January 2019].

Anon., 2017. tutorialspoint. [Online]


Available at: https://www.tutorialspoint.com/java/java_files_io.htm
[Accessed 19 January 2019].

Anon., 2018. JavaTpoint. [Online]


Available at: https://www.javatpoint.com/java-io
[Accessed 1 February 2019].

Anon., 2018. TechoPedia. [Online]


Available at: https://www.techopedia.com/definition/3927/java
[Accessed 10 January 2019].

Anon., 2018. ThoughtCo,. [Online]


Available at: https://www.thoughtco.com/what-is-java-2034117
[Accessed 1 January 2019].

Page | 27

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

Anon., 2019. Java. [Online]


Available at: https://www.java.com/en/download/faq/whatis_java.xml
[Accessed 18 January 2019].

Marx, D., 2016. DZone. [Online]


Available at: https://dzone.com/articles/netbeans-74-json-support
[Accessed 20 january 2019].

Page | 28

Downloaded by james smith (smthjames786@gmail.com)


lOMoARcPSD|8934162

Workload Matrix

Name Work in Percentage Signature

Anish Mandal 100%

Page | 29

Downloaded by james smith (smthjames786@gmail.com)

You might also like