Nothing Special   »   [go: up one dir, main page]

Online Shopping Cart

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 16

MINI PROJECT

ON

ONLINE SHOPPING CART USING C


PROGRAM

Documented by
CHRISTY JOHNSON
Candidate SFID: 104287

1
TABLE OF CONTENTS

ABSTRACT 3

PROBLEM STATEMENT 3
Motivation 4

RESEARCH 4

REQUIREMENTS GATHERING 6
Hardware Interface 7
Software Interface 7
Product Function 7
Functional Requirements 7
Performance Requirements 8

IMPLEMENTATION 8
Activity Diagram 11

TESTING 13
Test Cases 14
Results 15

CONCLUSION 16

FUTURE WORK 16

2
ABSTRACT

Electronic commerce, also known as ecommerce is a type of industry where buying and selling
of a product is conducted over electronic systems such as the internet. The purpose of this
project is to bring knowledge about ecommerce and to create a simple backend online shopping
application using C programming. The development of this new system contains the following
activities:

1. Secure login and profile management facilities for Customers.

2. Browsing through the eMall to see the items that are there in each category of products
like Apparel, Kitchen accessories, Mobile phones etc.

3. Showing specifications of each item.

4. Creating a Shopping cart so that customers can shop a number of items and checkout
finally with the entire shopping cart.

PROBLEM STATEMENT

It is known globally that, in today’s market, it is extremely difficult to start a new small-scale
business and its sustenance with competition from the well-established and settled/brand
owners. Most often, even if the quality of the product is really good, due to a lack of
advertisement or business at the small scale, it just becomes another face in the sea, and the
product does not reach a larger group of customers. In the fast paced life of today when
everyone is squeezed for time, the majority of people are finicky when it comes to doing
physical shopping.

Logistically, a consumer finds a product more interesting and attractive when they find it on the
website of a retailer directly and are able to see the item's details online. The customers of
today are not only attracted because online shopping is very convenient, but also because they
have broader selections, highly competitive prices, better information about the product
(including people’s reviews) and extremely simplified navigation for searching regarding the
product. Moreover, business owners often offer online shopping options at low rates because
the overhead expenses in opening and running a physical store are higher. Further, with online
shopping, their products have access to a worldwide market, which increases the number of
customers from different ethnic groups, adds customer value, and overall sustainable in the
marketing.

3
Motivation

The motivation for designing this shopping-cart application came because I love online shopping
rather than spending a lot of time at physical markets. Further, using the available stores to sell
the products, there is also the possibility of designing one’s own customized shopping-cart
application from scratch because custom-designed platforms are expensive. Moreover, I value
recent learning about C programming languages as well as seeing how powerful they are when
it comes to backend applications.

RESEARCH

The history of ecommerce shopping carts began immediately after the World Wide Web, or
WWW, became a major medium to communicate information around the world. Ecommerce
shopping-cart applications allow consumers to buy goods or services directly over the internet
using a web browser. This online shopping evokes the business-to-consumer (B2C) process
where a consumer buys directly from the business. The process where a business buys from
another business is called a business-to-business (B2B) process. The best examples of
shopping- cart applications using the B2B process are eBay and Amazon, both of which were
launched in 1995. At present, most users of these online shopping-cart applications are people
who have higher levels of education, have exposure to technological advancements, and are in
a better income group. Such users develop a positive attitude towards these convenient
shopping techniques. According to a study in December 2011, Equation Research surveyed
1,500 online shoppers and found that 87% of tablet owners made online transactions during the
early Christmas shopping season.

Building a new successful shopping cart is simple because of high competition in the market,
and the designer of a shopping-cart application must consider the information load, complexity,
and novelty. Complexity refers to the number of features available on the shopping cart and the
levels of marketing, whereas novelty involves the unexpected or unfamiliar aspects of the site. A
designer must also consider the consumers’ needs and expectations. A user-friendly design is
very critical to the success of any shopping-cart application because, unlike physical stores,
consumers at online stores come from all ages, genders, and cultures. Logistics clearly says
that, to have a successful and profitable online shopping application, businesses have to spend
a significant amount of time and money for designing, developing, testing, and maintaining the
application. Apart from the high-class design and user interface, a good practice needs to be
done to provide quality customer service.

A typical shopping cart should contain certain features such as adding items to the cart and
checking out those items using the available payment methods. Most shopping-cart applications
are implemented using HTTP cookies or query strings, and an HTML setup is required to install
the shopping cart on the servers that ultimately hosts the site on the internet. Most of these
server-based applications require data related to the items added in the shopping cart to be kept
in a session object which can be accessed later and manipulated dynamically because the
users can add or remove one or more items from the cart. Most simple shopping-cart
applications do not allow checkout to be done before any items are added to the cart. Data is
often stored in an external database or application-based databases which can be accessed in
real time by the application administrator.

There are many examples of online shopping applications developed in different languages.
Choosing a development platform and language depends on policies set by the company for
which the application is being designed. It also depends on several other factors which are very

4
important when considering the platform to design an application, for example, how portable the
application will be after being built or if the application is open sourced. Java is chosen for this
application because various reasons:

1. C is a structured programming language which allows a complex program to be broken


into simpler programs called functions. It also allows free movement of data across
these functions.
2. Various features of C including direct access to machine level hardware APIs, the
presence of C compilers, deterministic resource use and dynamic memory allocation
make C language an optimum choice for scripting applications.
3. As a middle-level language, C combines the features of both high-level and low-level
languages. It can be used for low-level programming, such as scripting for drivers and
kernels and it also supports functions of high-level programming languages, such as
scripting for software applications etc.
4. C is highly portable and is used for scripting system applications which form a major part
of Windows, UNIX, and Linux operating systems.
5. C is a general-purpose programming language and can efficiently work on enterprise
applications, games, graphics, and applications requiring calculations, etc.
6. C implements algorithms and data structures swiftly, facilitating faster computations in
programs. This has enabled the use of C in applications requiring higher degrees of
calculations like MATLAB and Mathematica.

Riding on these advantages, C became dominant and spread quickly beyond Bell Labs
replacing many well-known languages, such as ALGOL, B, PL/I, FORTRAN, etc. C language
has become available on a very wide range of platforms, from embedded microcontrollers to
supercomputers.

REQUIREMENTS GATHERING
The requirements analysis and gathering processes are critical for the success of any software
engineering project.Requirements analysis in software engineering is a process that determines
the tasks that are required to determine the needs and conditions to design a new product or to
make modifications in any existing product/application. This process considers all the
stakeholders’ conflicting requirements, and analyzes the documentation and validation of the
system. The requirements should be actionable, measurable, testable, and related to the
defined needs of the system design. From the software-engineering perspective, requirements
analysis is a three-step process:

5
1. Requirements Elicitation: Elicitation of requirements, also known as requirements
gathering, includes the task of identifying various requirement types from stakeholders or
from project documentation.
2. Requirements Analysis: Analysis of requirements determines if the gathered
requirements are clear, complete, and consistent. The analysis also handles any
ambiguous requirements that do not clearly state what needs to be implemented, which
could create a loss of resources and time if identified later in the development or testing
phase.
3. Requirements Documentation: This step involves documenting the requirements in
variousforms, including summary lists, natural language documents, visual documents,
use cases, user stories, or process specifications. A requirement specification document
is categorized in different ways according to the stakeholders’ need, helping to create a
clear contract between de1. Operating System: Windows (Vista/Windows 7) or MAC
OS development and business. The following sections include the different categories of
requirements specification documents that are essential for designing this application:
the functional requirements, constraints, system requirements, etc.

Hardware Interface

The online shopping-cart application shall provide minimum hardware requirements. The
following hardware configurations are required for a PC using the online shopping-cart
application:
1. Pentium processor
2. 32 MB of free hard-drive space
3. 128 MB of RAM

Software Interface

This section lists the requirements that are needed to run the system efficiently:

1. Operating System: Windows (Vista/Windows 7) or MAC OS


2. C compiler: To compile and run a C language program, you need a C compiler. To setup
a C language compiler in your Computer/laptop, there are two ways:

i) Download a full fledged IDE like Turbo C or Microsoft Visual C++, which comes along
with a C language compiler.

ii) Or, you use any text editor to edit the program files and download the C compiler
separately.

3. Third-Party Tool: Microsoft Word can be used for any editing purposes.

Product Function

The online shopping-cart application would have the following basic functions:

6
1. Allow the user to login into the system using a username and password.
2. Display all the categories available for shopping on the system’s main page.
3. Display all the items linked to each category listed on the main page.
4. Display the specifications of the item linked to each category.
5. Allow the user to add new items to the existing list of available items.
6. Allow the user to checkout the items in the cart.

Functional Requirements

The users shall be able to see the home page of the online shopping-cart application when they
first run the program. The users shall be able to view the different categories, select categories,
browse through the items in each category, and add items to the shopping cart. The users shall
be able to view the shopping cart and more information about each item.
● FR01: The users shall login using the user authentication form.
● FR02: The users shall not login or register if the information is incomplete or invalid.
● FR03: The users shall be able to view the categories on the program’s output window.
● FR04: The users shall be able to view items in different categories.
● FR05: The users shall be able to add items to the cart.
● FR06: The users shall be able to view more information about an item before adding it to
the cart.
● FR07: The users shall be able to view the shopping cart.
● FR08: The users shall be able to browse through the available items.
● FR09: The users shall be able to view the items added to the cart.
● FR10: The users shall be able to check out with the current items in the cart.
● FR11: The users shall be able to continue shopping.
● FR12: The users shall be able to delete items from the cart.

Performance Requirements
This section lists the performance requirements expected from the online shopping-cart
application:
● PR01: The users shall be able to add an item to the cart in fewer than 5 seconds.
● PR01: The users shall be able to view information about an item in fewer than 5
seconds.
● PR03: The users shall be able to check out the items in the shopping cart within 10
seconds after completing the order form.
● PR04: The navigation between functions shall take fewer than 5 seconds.
● PR05: The application shall be able to do a validation check on the information provided
in the user-authentication form to avoid false or incomplete information.

7
IMPLEMENTATION

This includes the detailed design used to build the online shopping-cart application. This design
stage takes the initial input requirements that were identified in the approved requirements
specification document. For each requirement, there is a set of one or more design elements
that are produced using the different prototypes. Below are the different use cases in the
system, the use case, and the actors associated with each use case. The description is used for
a novice user to better understand the workings of the system and the pre-conditions that
should be satisfied before invoking each use case.

1. Use-Case Number: US-001


Use-Case Name: Login
Use-Case Description: This use case helps the User to login into the user-
authentication form.
Primary Actor: User
Precondition: The user must correctly type the username and password.
Post-condition: The user is successfully able to log in.
Basic Flow:
● Run the code.
● Login

2. Use-case number: US-002


Use-case name: Select category
Use-case description: This use case details the category for selecting a process where
the user can browse through the different categories and select one category to view
items.
Primary actor: User
Precondition: The user successfully login into the application to view the home page
and browse different categories.
Post-condition: The user successfully selects a category to view items in a particular
category.
Basic Flow:
● Run the code
● Successfully login
● Browse the categories
● Select a category
● Browse through the items

3. Use-Case Number: US-003


Use-Case Name: Add Item
Use-Case Description: This details the item-adding process for the system to access it.
The user should be able to add items to the cart and view information about the item.
Primary Actor: Admin/User
Precondition: The items available for shopping are available for the user to browse.

8
Post-condition: The user successfully adds items to the cart.
Basic Flow:
● Run the code
● Successfully login
● Browse the categories
● Select a category
● Browse through the items
● Add items to the cart.

4. Use-Case Number: US-004


Use-Case Name: View cart
Use-Case Description: This use case helps the user to view the shopping cart in the
application.
Primary Actor: User
Precondition: None. The cart can be viewed with or without adding any items.
Post-condition: The user successfully adds the item to the shopping cart.
Basic Flow:
● Run the code
● Successfully login
● Browse the categories
● Select a category
● Browse through the items
● Add items to the cart
● View cart
Exceptional Flow:
● Run the code
● Successfully login
● Do not add items to the cart
● View empty cart

5. Use-Case Number: US-005


Use-Case Name: Continue shopping
Use-Case Description: This use case helps the user to decide whether he or she would
like to continue shopping after adding the item to the shopping cart or when he or she
views the empty cart.
Primary Actor: User
Precondition: Continue shopping
Post-condition: The user is successfully able to view the shopping cart with the option
to continue shopping or to check out when there are items in the cart, or to continue
shopping when there are no items in the cart.
Basic Flow:
● Run the code
● Successfully login
● Browse the categories

9
● Select a category
● Browse through the items
● Add items to the cart
● View cart
● Continue shopping/check out
Exceptional Flow:
● Run the code
● Successfully login
● Browse the categories
● Do not add items to the cart
● View empty cart
● Continue shopping

6. Use-Case Number: US-006


Use Case Name: Checkout
Use-Case Description: This use case helps the User to check out items from the
shopping cart.
Primary Actor: User
Precondition: There is at least one item in the shopping cart to cause the checkout.
Post-condition: The user is able to do checkout when there are items in the cart.

Basic Flow:
● Run the code
● Successfully login
● Browse the categories
● Select a category
● Browse through the items
● Add items to the cart
● View cart
● Checkout
Exceptional Flow:
● Run the code
● Successfully login
● Browse the categories
● Do not add any item to the cart.
● View empty cart
● Checkout

Activity Diagram
The figure below demonstrates the activity flow for this online shopping-cart application. . The
flow begins when the user successfully login into the system. The user can browse through the
available list of categories. In the category, a user can select and view more information for

10
details about a particular item before deciding to add it to the shopping cart. The user can then
view his cart and can then decide to either continue shopping or proceed to checkout.

11
12
TESTING
In the process, all aspects of the software were tested. Steps to follow while implementing the
methodology are as follows:
1. Start with a base function that you want to implement.
2. Create a document with the detailed requirement definition, an activity diagram with a
description of the flow, database tables to be used, a component diagram, and a
description of each component with the precondition and tables that would be affected
by the component.
3. Give the document to the tester, and work with the tester while he or she writes the code
to check if the steps in the document can be implemented and if the result of each use
case can be achieved.
4. If the tester finds a step difficult to implement or thinks he or she is missing additional
information to implement the functionality, then go to step 2; otherwise, go to step 3.
5. Ask the tester to log on all the errors and difficulties he or she encountered while working
on the prototype implementation.
6. Once the prototype is done and the results between the developer’s prototype and
tester’s prototype match, work on the other requirement, and expand the prototype to
final software.

Table lists the functional requirements for the interface built for the online shopping- cart
application, along with a short description of each requirement:

Functional Requirement Functional Requirement Short Description


No.

FR01 The online shopping-cart application should have user


authentication.

FR02 The online shopping-cart application shall be accessible


to all the users to browse all the categories and the
items.

FR03 The user should be able to see the specification of the


selected item

FR04 .The user should be able to add items to the cart.

FR05 The users shall be able to view the items they added to
the shopping cart.

FR06 The user should be able checkout with the selected


items in the cart.

13
Test Cases

Functional Test Case Test-Case Short Description


Requirement No.
No.

FR01 TC01 To test the login/authentication interface for the user

FR03 TC02 To test the user see the specification of selected item

FR04 TC03 To test the user is able to add items to the cart

FR05 TC04 To test whether the user see the items added to the cart

FR06 TC05 To test whether the user is able to checkout with the selected items
in the cart.

The following list includes the steps that should be taken by the user, the conditions that should
be met for the successful execution of the test case, and the end result that should be met for
the test cases to pass.

1. TC01: To test the login/authentication interface


● Input: Username and Password
● Output: Enter into the shopping interface.
● Valid Range: Username -> Alphanumeric, Password -> Alphanumeric
● End Messages/Result
A. If (User == Valid User) and (Password == correct) user can access the
shopping site.
B. If (User != Valid User), an error message is displayed on the Login
interface.

2. TC02: To test the user see the specification of selected item


● Description of Purpose: The program should be able to show the specifications of
the selected item.
● Input: Item which is selected by the user.
● Output: Specification of the selected item.
● Expected Result: The user is able to see the specification of the selected item.

3. TC03: To test the user is able to add items to the cart


● Description of Purpose: The program should be able to add the items selected by
the user to the cart.
● Input: Item which is selected by the user.
● Output: Selected item is added to the cart.
● Expected Result: The user is able to add the selected items to the cart.

14
4. TC04: To test whether the user see the items added to the cart
● Description of Purpose: The program shows all the saved items in the shopping
cart for a particular user. The user can choose to check out the items or go back
to continue shopping.
● Input: The user adds an item to the shopping cart from any of the available
categories.
● Output: The shopping-cart page pops up, showing the item that is added by the
user.
● Expected Result: The user is able to add that item to the cart, and the item
shows up in the shopping cart, prompting the user to delete the item, to continue
shopping, or to check out the item.

5. TC05: To test whether the user is able to checkout with the selected items in the cart.
● Description of Purpose: The program should be able to checkout with the
selected number of items in the cart.
● Input: Items that are present in the cart.
● Output: Checkout completes with selected items by the user
● Expected Result: The user successfully checked out with the selected items.

Results
This section lists the results that were produced by running the test cases. Table shown below
lists the test cases that were used while testing the interface along with the expected result and
the actual results for each test case.

Test Case Number Expected Result Actual Result

TC01 Pass Pass

TC02 Pass Pass

TC03 Pass Pass

TC04 Pass Pass

TC05 Pass Pass

15
CONCLUSION
The main objective of the application is to get a better understanding about the concepts in C
programming language. It gives me a great insight on constants, variables and data types in C,
managing input and output operations, decision making and looping, arrays, character arrays
and strings, user defined function in C, file management in C etc. The following results have
been achieved after completing the program and relate back to the program’s objective:
1. Should allow users to browse through different product categories.
2. Should allow users to save items to the cart and also to view detailed information about
a particular item.
3. Should allow users to check out the items.

FUTURE WORK
The following section discusses the work that will be implemented with future releases of the
program:
1. Detailed categories: Future work could involve adding more categories which are more
detailed and have additional items.
2. Payment Options: Add different payment options, such as Visa, MasterCard, PayPal,
etc., where a user can also save the card information for later checkouts.
3. Shipping Options: Add different types of shipping options: regular shipping, expedited
shipping, international shipping, etc.
4. Recent History: Display the user’s recently browsed items.

16

You might also like