Design Of A Computerized Stock Control System Computer Science Essay

Published:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

The scenario

The stationery shop requires a computerised record system for the monitoring and ordering of stock. The current system is a manual system for recording purchases made and for monitoring stock levels and determining when to order new stock and how much to order.

Customers who wish to pay by debit card, credit or cheque must register with the store. Many customers opt to pay by cash and not give their details to the store.

It is hoped that the computerised system will ensure that sufficient stock levels are maintained for all items in the store. The generation of reports will allow the manager to target the marketing of products to specific customers based on their previous purchases (for example small businesses may order printer cartridges and paper in bulk) and keep a close check on the financial performance of the shop.

The manager will have overall control of the system but the sales staff will be responsible for updating all records as new purchases are added, as customers make new purchases, and as new stock is delivered. The sales staff will require access to view customer records and stock records in order to check details of the specific customers and stock items. The manager will want regular reports of total items bought in each month by stock item, and also the total stock in the shop at any time.

1.0 Task 1

The shop manager requires the following reports:

Report 1: A monthly list of total number of items purchased by stock item, listing number sold, purchase price and total payment received for each stock item.

Report2: A list of the stock in the shop, by stock item , listing stock item and number in the shop .This list can be generated at any time for stocktaking purposes.

Using JSP techniques and methodology analyse the requirements for both reports. Produce diagrams for each report showing the step- wise progression .Diagrams should include:

Logical data structure diagrams (DSDs)

Preliminary program structures (PSDs)

The detailed program specification for each report

1.1Report 1:

A Monthly list of the total items purchased, by stock item, listing number sold, purchase price and total payment received for each stock item.

1.1.1Logical data structure Diagrams (DSDs)

1.1.2 - Preliminary program structures-report 1

The step-wise progression of the JSP diagrams is shown below:

Diagrams Refinement 1:

At top-level, the following components imply:

Initialising: Opening all files

Processing: Produce a report containing the total number of items purchased listing number sold, purchase price and total payment received by each stock item.

Closing: Closing all files.

Diagram refinement 2:

Diagrams Refinement 3:

1.1.3 Detailed program specification-report 1

Level 1-report

Level 2 -closing

Level 2-processing

Level 2 - initialization

Level 3 - processing

Level 1: deals with the whole system

Level 2:

Initialization - 1. The file must be open to read the purchase file

2. Read purchase file

Processing

Closing - 1. Close purchase file

2. Print reports

3. End program

Level 3:

Processing: Processing the calculation for the monthly total number of items purchased and total payment received for each stock item.

1.2 Report 2: A list of total stock in the shop, by stock item, listing stock item and number in the shop. This list can be generated at any time for stocktaking purposes

1.2.1logical data structure

1.2.2preliminary program structure -report 2

The step-wise progression of the JSP diagrams is shown below:

Diagrams Refinement 1:

Diagram refinement 2:

Diagram refinement 3:

1.2.3 Detailed program specification-report 2

LEVEL 1-start

LEVEL 2-closing

LEVEL 2-Initialisation

LEVEL 2-Processing

LEVEL 3-processing

Level 1: deals with the whole system

Level 2:

Initialization - 1. The file must be open to read the purchase file

2. Read purchase file

Processing

Closing - 1. Close purchase file

2. Print reports

3. Stop program

Level 3:

Processing: processing the List of total stock in the shop

2.0Task 2

Write the pseudocode for both reports.

Draw a flowchart for both reports.

2.1 Pseudocode

2.1.1Report1

START Program

USE Variables

Month _of TYPE month

Stock _item of TYPE Character

Purchase _stock of TYPE integer

Payment _received of TYPE Float

Number _of_ sold of TYPE integer

REPEAT

SET Stock Price = 0

SET number of items purchased= 0

SET Number of sold item= 0

SET Total payment received = 0

DISPLAY "Welcome to SNIT stationery shop"

DISPLAY "Stocks Details Menu"

DISPLAY "Input Month"

ACCEPT Month

DISPLAY "stock item"

ACCEPT "stock item"

DISPLAY "input number of items purchased"

ACCEPT "input number of items purchased"

DISPLAY "input list of sold item"

ACCEPT "list of sold item"

Number of sold item= purchased stock - current stock

DISPLAY "Input purchase price"

ACCEPT "purchase price"

Total payment received for each stock item= sold price - purchase price

DISPLAY Month, stock item, Number of sold item, Total payment received

UNTIL EOF

END Program

2.1.2Report 2

PROCEDURE Total

RECORD list

HAS FIELDS Stock _item of TYPE Character

Purchase _stock of TYPE integer

Number_ in_ shop of TYPE integer

Number _of_ sold of TYPE integer

Stocks [100]: ARRAY OF TYPE list -Assumption the value 100 is taken as stock

-An array is considered

Use variables Total _ stock of TYPE integer

n of TYPE integer

FOR (n: =1, n=100, +1)

DISPLAY input stock item

ACCEPT stock (n) stock_ item

DISPLAY input purchase stock

ACCEPT stock (n) purchase_ stock

DISPLAY input number of sold items

ACCEPT stock (n) number _of _sold items

Number in shop = total purchase_ stock - total number_ sold

END FOR

FOR (n: =1, n=100, +1)

DISPLAY stock _item

DISPLAY stock_ purchase

DISPLAY number _of _sold items

END FOR

FOR (n: =1, n=100, +1)

Total stock= total stock + number in shop

END FOR

DISPLAY "Total stock is", Total _stock

END PROGRAM

2.2 Flowchart

2.2.1Report 1

2.2.2Report 2

3.0Task3

Write the pseudocode

3.1 pseudo code for main menu

START Program

Use Variables Login, of Type STRING

Password of Type CHARACTER

Main Menu of Type INTEGER

START Procedure Entry Screen ( )

LOAD Procedure Welcome Screen

DISPLAY "SNIT stationery shop"

DISPLAY "Please Input your Login"

ACCEPT Login

DISPLAY "Please input your Password"

ACCEPT Password

If log in: = staff and password: = SNIT

Then Display "Access Granted for Staff" AND

If Log in: = admin and password: = manager

THEN Main Menu

Display "Access Granted for Manager"

ELSE

DISPLAY "Wrong Login! Re-try Please!"

END Procedure Welcome Screen

START Procedure Main_ Menu

LOAD Main Menu

DISPLAY "Welcome to SNIT stationery shop"

DISPLAY "Main Menu"

DISPLAY "Choose one of the following:"

DISPLAY "1 - Update Customer's records"

DISPLAY "2 -Add customer"

DISPLAY "3 -view stock details"

DISPLAY "4 -View customer details"

DISPLAY "5 - Add sale of stock item"

DISPLAY "6 -Add delivery of stock item"

DISPLAY "7-Update stock item (manager only)

DISPLAY "8-print report" (manager only)

DISPLAY "9 -Exit program"

Display Enter your option

Use variables option of TYPE character

ACCEPT option

DO CASE of Main Menu

CASE Main Menu = 1

DO update Customer records

CASE Main Menu = 2

DO add customer

CASE Main Menu = 3

DO view stock details

CASE Main Menu = 4

DO view customer details

CASE Main Menu = 5

DO add sale of stock item

CASE Main Menu = 6

DO add delivery of stock item

CASE Main Menu = 7

Do update stock item

CASE Main Menu = 8

DO print report

CASE Main Menu = 9

DO exit program

OTHERWISE

DISPLAY "Option not found! Please Re-enter Option"

END CASE

END Procedure Main Menu

3.2 Flowchart for main menu

Test name

test Description

input username

input password

Is username correct?

Is password correct?

actual result

expected outcome

staff

Character check

staff

SNAT

yes

no

no

Wrong password!

staff

Character check

sttaf

SNIT

No

yes

no

wrong input

staff

Character check

staff

SNIT

yes

yes

yes

load main menu for staff

staff

Character check

stafz

SnIY

no

no

no

wrong input

manager

Character check

admin

managet

yes

no

no

Wrong password!

manager

Character check

admen

manager

no

yes

no

wrong input

manager

Character check

admin

manager

yes

yes

yes

load main menu for staff

manager

Character check

asmin

mamager

no

no

no

wrong input

3.3 TEST DATA

3.3.1Test data 1 for log in

3.3.2 Test data for option

Main Menu

Test purpose

To test if option is accepted

Test data

expected outcome

1

valid option

2

valid option

3

valid option

4

valid option

5

valid option

6

valid option

7

valid option

8

valid option

9

valid option

AAA

invalid option

3.3.4 Test plan

test name

test description

input data

actual result

expected outcomes

option

integer check

1

yes

update customer details

option

integer check

a

no

wrong option

3.3.5 Dry Run for main menu

month

stock ID

purchase stock

actual stock

sold stock

unit price/RS

net income/Rs

January

001

500

400

100

11

100 * 11= 1100

January

002

300

175

125

8

125 * 8 =1000

February

0010

450

400

50

20

50 * 20 =1000

March

0017

800

300

500

5

500 * 5 =2500

3.3.6 Dry run 2:

Month

stock ID

purchase stock

purchase Price/Rs

sold stock

sold price/Rs

profit/Rs

January

001

500

9

100

11

100 * 2 =

200

March

0017

800

4

500

5

500 * 1 = 500

October

0028

600

10

300

8

300 * 2 = 600

4.0 Task 4

Explain the options available that would enable the system to deal with cash customers who do not wish to register their details with the store. (2 Marks) Suggest ways in which customers could be encouraged to register their details. (3 Marks)

4.1 Options available that would enable the system to deal with cash customers are

First option:

Even in automated system invoice with name as CASH can be used.

Debit card or credit card

The above diagram is a typical invoice from an automated stationary system. The system deals it as cash customer. Whenever a customer made an order the sale would be entered in the database as cash sale.

Second Options:

To deals with cash user the system would have to add entry as Cash 1, 2, 3, 4 etc in the system. This should be done to monitor a consistent annual report.

Uses automated system are being used to financial details of the activity of the system. This report along with potential customer name would be transfer to the marketing department.

So cash customer would have to be entered as CASH 1 in the database.

Ways in which customers could be encouraged to register their details are:

Free gift: To encourage customer to register special incentive can be given such as free gift. Some beautiful pen can be given to registered customers. In doing so ,the cash customer would be tempted to register to the system

Discount on specific product: Discount can be give on note books for registered user. For example a notebook costing, Rs 50 can be given to registered customer at Rs 25 for a specific period of time. This would stimulate customer to register with the system.

Fidelity cards: Fidelity cards, all registered user will have a fidelity card. This will allow the customer to beneficiate with special treatment. Special treatment such as a staff allocated for the user. Each time he/she came to the shop, he need to go directly to the staff.

5.0 Task 5

Give a detailed explanation of how modelling the new system using object-oriented (OO) methods would differ from the methods used in tasks 1 - 4 above. Describe the different diagrams that would be used and explain the steps taken to design the system

5.1 An explanation on object-oriented methods

Object-Oriented Technology is the division of a system into components or modules that are interrelated and loosely-attached to one another. A component is said to be interrelated if it has a single, clearly-defined purpose and it makes an important contribution to the well functioning of the system. A system composed of interrelated components seems to be easier to implement and to maintain, if component has distinct purpose. It is not difficult to find necessary change, such as faults or changing requirements. An automated stationary shop offers a user the options to make an order rapidly. It has been decided to offer a service to allow customers to have printed copy of their receipts when ordering. The only thing that needs to be done is to create a new module to execute the function and to connect it to the system.

Why use OOT?

For the implementation of automated stationary shop can use Object-Oriented design, this would be helpful as it would allow upsizing and increasing the services. Today we are living in a continuously evolving world; changes need to continue to keep in touch with the latest tendency. Likely in business we need to innovate and bring introduce new strategies to be more competitive. The automatically stationary shop could be based on OOT to be easier to deal with changing needs and demands for good service.

Object Oriented Software Engineering (OOSE) deals with the language using OO such as VB.NET, Java language and ASP.NET. Concepts and notation from OOSE could be incorporated into Unified Modelling Language (UML) during its development.

5.2 Unified Modelling Language (UML) Diagrams

Types of UML Diagram:

5.2.1Use Case diagram

Use case diagram concentrate on the user's point of view (the point of view of the person using the system).The use case is what the actor wants to achieve

The stationary shop entails the following these steps:

Staff update all records for customers

Staff can view stocks record and customer record

Manager can print report at any time

Customer may paid by cash ,debit card or credit card

Use case diagram for staff

Update customer record

Staff

Exit program

Add delivery of stock item

Add sale of stock item

View customer details

View stock details

Add customer

Scenario description

The sales staff can update all records as new customers are added, make new purchases, and as new stock are delivered. Moreover staff will be able to view customer record and stock records in order to check details of specific customers and stock item

Use case diagram for Manager

Exit program

Print report

Update stock item

Scenario description

The manager can target the marketing of products to specific customers based on their previous purchases by printing reports. Furthermore managers can update stock item and keep a close check on the financial performance of the shop.

Use diagram for customers registration

Scenario Description

The staffs interact with the server through his application by clicking on the page request for the registration form. The application displays the interface returned by server; the staffs fill it in and post the details. Validation checks are performed on the data collected and the processed data is saved accordingly on validation success.

Use diagram for Retrieve Orders

Scenario Description

When the person requests to view the list of orders placed by users, the application would send a query to database to display orders placed for today. For each order the personnel has three options either to view the profile of the user who has placed the order or to view the list of products that user has ordered or to dispatch the order for assembly and/or for delivery.

Use diagram for Reports

Scenario Description:

When the manager made a request to draft reports, the staffs have to select among three options: either to count number of registered users or to count number of products or to list all orders by date. According the selected option the application would fetch the information from database and display it. All the necessary computation would be done. If an invalid input is given an error message would be displayed.

A case diagram showing inclusion of the 'creating a new customer record' scenario:

Creating a new customer record

<<INCLUDE>>

Staff

<<INCLUDE>>

<<INCLUDE>>

<<INCLUDE>>

Address

Phone number

Surname

Name

A case diagram showing inclusion of the 'printing reports' scenario:

Shop name

Manager

Printing reports

<<INCLUDE>>

Total Stocks in shop

<<INCLUDE>>

<<INCLUDE>>

<<INCLUDE>>

<<INCLUDE>>

Total Items bought

Total payment received

Customer details

<<INCLUDE>>

Stock details

5.2.2 Class diagram

Class diagram expresses the classes of object found in the system

Manager

Staff

Customer

Stationary shop

The class automated stationary shop consists of a number of components. This is a special type of relationship called an aggregation.

Customer

First name : character

Surname: Character

Address: Character

Phone number: string

Add ( )

Update ( )

Delete ( )

Product

Product ID: string

Product name: character

Product size: string

Price: integer

Add ( )

Update ( )

Delete ( )

5.2.3Sequence diagram

Sequence diagram show how objects in the system will interact with each other

Registration

A typical sequence for a customer registering in the system

Retrieve Orders

Draft Reports

In the diagram the customer is the actor. The user would request to be register with the shop

5.3.4 Collaboration diagram

Collaboration diagrams show how the elements of the system being developed collaborate or work together to achieve the system purpose.

The diagram below show a typical collaboration diagram that show the step a staff need to take to log in the shop application

Steps taken to design the system

Step1: Identify the classes to be designed.

Start from the requirements and specifications. Look for what seem like the "objects" that the user and/or the program must work with.

For example, in Internet Chess, the game board, the pieces, the history list, the connection to the other computer, the chat messages, etc.

Step2: Identify the public methods of each class.

What do the users, or the program, need to do with the objects identified in step 1?

For example, what do we do with the chess board? We make a move, or take back a move, or determine if a proposed move is legal.

6.0 Task 6

In no more than 500 words write a review of your work. Describe any assumptions you have made, any weaknesses in your work and any changes you could introduce to improve your work. For the different methods and techniques you have used or described in tasks 1-5, suggest which methods would be appropriate for different programming languages.

6.1 Review

6.1. 1Task 1:

The JSP (Jackson structured Programming) technique has been used to analyze the requirements of the reports. This is because JSP is a method for program development, which starts from data streams to create a program. The JSP methodology prescribes a strict schema that should be followed in the program creation.

6.1.2 Task 2:

Pseudocode and Flowchart: A pseudocode is easily understood while Flowcharts are applied to formulize graphical representation of the program logic sequence of the reports created in task 1.Assuming that report generated each Month.

6.1.3 Task 3:

Pseudocode and flowchart: Pseudocode is used particularly because it is a detailed yet readable description of what a computer program or algorithm must do. Assuming that Sales-Staff, and Manager would have different character and password. It has been assumed that Username would be displayed in a combo box, where user would have to select appropriate Username, and then type their password.

Test plans, desks and dry runs: Test plans, dry runs and desk checks are used to countercheck the pseudocode and flowchart done for the main menu.

6.1.4 Task 4

Task 4 consists of mentioning the different option available that would enable the system to deal with cash customers and how to encourage them to register their details.

6.1.5 Task 5

UML stands for "Unified Modeling Language." This is a programming language that is used for object-oriented software development. To organize program code more efficiently, programmers often create "objects" that are sets of structured data within programs. UML, which has been standardized by the Object Management Group (OMG), was designed for this purpose. The language has gained enough support that it has become a standard language for visualizing and constructing software programs.

e.g. - Class diagram

- Object Oriented

6.2 Assumptions made:

In reference to task 2 for report 2, the value 100 is taken for stock as an array is considered.

6.3 Weakness in my work:

Instead of using JSP techniques and methodology to analyse the requirement for reports we could simply use object-oriented (00) methods directly.

6.4 Improvement:

For the task 3, flowcharts should have been asked to do at the first place as it is simpler to understand.

6.5 Method appropriate for different programming languages

In my point of view, UML is the most suitable method as the class diagrams describes the static structure of the system. Use case diagrams model the functionality of the system using actors and use cases. Activity diagrams illustrate the dynamic nature of a system by the flow of control from activity to activity.

Advantages of UML

We are able to visualise platform artifacts while preventing the need for an extra level of transformation.

UML profiles provide a simple approach that is easily implemented using readily existing UML tooling.

Models with UML profiles applied can be read by all UML tools, it is user-friendly.

UML can be used for high-level architectural models and detailed models from which code can be generated.

WORLD WIDE WEB

IN-TEXT

Writing Services

Essay Writing
Service

Find out how the very best essay writing service can help you accomplish more and achieve higher marks today.

Assignment Writing Service

From complicated assignments to tricky tasks, our experts can tackle virtually any question thrown at them.

Dissertation Writing Service

A dissertation (also known as a thesis or research project) is probably the most important piece of work for any student! From full dissertations to individual chapters, we’re on hand to support you.

Coursework Writing Service

Our expert qualified writers can help you get your coursework right first time, every time.

Dissertation Proposal Service

The first step to completing a dissertation is to create a proposal that talks about what you wish to do. Our experts can design suitable methodologies - perfect to help you get started with a dissertation.

Report Writing
Service

Reports for any audience. Perfectly structured, professionally written, and tailored to suit your exact requirements.

Essay Skeleton Answer Service

If you’re just looking for some help to get started on an essay, our outline service provides you with a perfect essay plan.

Marking & Proofreading Service

Not sure if your work is hitting the mark? Struggling to get feedback from your lecturer? Our premium marking service was created just for you - get the feedback you deserve now.

Exam Revision
Service

Exams can be one of the most stressful experiences you’ll ever have! Revision is key, and we’re here to help. With custom created revision notes and exam answers, you’ll never feel underprepared again.