You are on page 1of 46

Introduction to Software Development: Developing Software Solutions

Due Date: Friday 6th September 2013

Year: 11
Saqib Khan, Hant Patel, Zaman Al Muddaris and Faraz Shaid Software Design Development Year: 11

[Type text]

Page 1

Contents

Software Design Development

Page 2

Introduction
The purpose of this project is to present our groups chosen scenario to simulate and create a supermarket cash register. This is usually used to calculate the total number of sale a customer was able to purchase, and will also give the people the proper change and the respective receipts with what they are buying. Attached to cash register is a cash drawer, and this drawer will open during the process of the transaction and will allow the cashier to make the change necessary for the customer. If there are no changes required, the receipts will just immediately comes out from the said device. Cash register is commonly seen within a department store, since it is one way where they can give fast services to their customers. Instead of making manual calculations with all the items being purchased by the customer, cash register is one way to calculate all the sales right away and without any waste of time, one can immediately give the fast services that the customer expect from the retailer. In order to start the process with this cash register, the sales clerk will only scan a certain item with its corresponding bar code scanner, and this will allow the register to display the current price of each item being purchase by the customer. When the sales clerk is done with it, she will then put the payment amount on the register and immediately calculation will certain follow. If there are change that should be given to the customer, the cash drawer will also open immediately for the cashier to get the change, and the receipts will immediately follow. A receipt will come out when the process is already completed, and the items are being keyed out of the store's inventory records right away. This record will help the store to have an accurate check during their inventory. In every item being purchase, there is also a corresponding record on it. The register will going to keep each record of every item being purchase, and it will be printed out at the end of the day for their inventory. It is also advisable that cash drawers will be counted from time to time in order to ensure that the cash register always has its appropriate amount of money in order to conduct the process. If the retailer is going to handle the said device, make sure to observe strictly the procedures and safety precautions, so that all transactions are made to be safe. The safety rules, programming of the department key, basic set up of the said device, and all transactions necessary to operate the cash register must always be taken into consideration. Cash registers make every transaction fast and easy especially for the sales clerk. A simple scan of every item will immediately program the different records of each item. This device will not only benefit the customers, but in the same manner it is also a great advantage for the store owner since it will enable them to have an accurate inventory at the end of the day. Cash Registers are one of the effective ways of rendering the fast services to the customers especially when you are a sales clerk.

Software Design Development

Page 3

Problem Statement
UNIPAD a multi billionaire company has asked us to create cash register software like a supermarket cash register but with more functions and accurate information. The software will allow a barcode to be inputted form the keyboard and the product price and description will be displayed on the screen. Once all items have been entered, the amount due should be displayed. An appropriate message will be displayed when the entered barcode does not have a product associated with it. The program will accept an amount tendered by the customer and calculate the change due. The product description file will contain at least twenty different products.

Software Design Development

Page 4

Software Design Development

Page 5

Gantt chart

[Type text]

Page 6

[Type text]

Page 7

Subroutines
Since our task does not require subroutine we dont have a subroutine in our program.

[Type text]

Page 8

IPO Chart
Input Typing the password in the Star up form

Processing

Output The user will enter the main window

Checking if the password is correct Retrieving the password form the database. Check if the barcode is valid Get the barcode from the user

Barcode/Barcodes

The barcode will be displayed. The item associated with the barcode will be displayed. The price associated with the barcode will be displayed. Display the total price so far within the transaction.

Cash Given

Check if the cash given is less than the total amount Get the cash tendered from the user

Change received

Multiply price by count

The total sum of products

[Type text]

Page 9

Subtract cash given by total amount

The change received.

[Type text]

Page 10

Data Dictionary

Field Name Data Type Password Barcode Cash Given Displayed barcode String Integer Currency Integer

Length 3 5 3 5

Format Xxx XXXXX xx.xx XXXXX

Example xxx 51342 $78.23 51342

Item name Price Total price Change Received

String Currency Currency Currency

10 5 5 3

Xxxxx xx.xx xx.xx Xxx

Apple $5.76 $85.76 $23

[Type text]

Page 11

Data Flow Diagram

USERS LOGING

Customer

Customer s

Prices
Payment Receipt Prices

Items to Purchase

Identif y Items

Item ID

Look up Prices

Items and Prices

Comput e Total Cost of the Order

Amount to be Paid

Settle Transacti on and Issue Receipt

[Type text]

Page 12

Storyboard of Software SolutionUpdate Exit

Add Exit

Enter

Exit Change Exit

Admin Item
Change Password Add Edit

Receipt

item Item

Remove Item

[Type text]

Page 13

Item
Barcode Items Count Price

Admin Item
Change Password Add item Edit Item
Remove Item

Barcode Items

Receipt

[Type text]

Page 14

BEGIN Is it Valid Display Main Screen

Enter Password Select Items Enter Barcode Barcode invalid Display Total Price

Display Item Cost Price

Display Item Name

Enter Cash Tendered Cash Tendered < Total Price Display Change Received

Display Error

Display Error

END

NO NO NO YES YES
END

System Flowchart of solution


[Type text] Page 15

YES

[Type text]

Page 16

Algorithm of your solution


BEGIN Main Program Enter password Determine Products Purchased Finalise Transaction END BEGIN Password Enter Password IF Password is incorrect then display error message Else Display Main Screen End IF END BEGIN Product List Customers Read Product List REPEAT Customer Enter Barcode IF Barcode enter is invalid THEN Display Error message Else display System display Price System display Item name System display Total Cost Display Item count End IF UNTIL Customers finished shopping END Product List BEGIN Add Item Enter Barcode for the item IF Barcode entered exist display error Else Enter the Item Name IF Item name exist than display error Else Enter Buy Price for Items Enter Sell Price If sell price < buy price than Display Error End if End if End if END ADD ITEM [Type text] Page 17

BEGIN EDIT ITEM Update Barcode IF Barcode exist than Display error Else Update Product name filed If product name exist than Display error Else Update Buy Price field Update Sell Price field END IF END IF END EDIT ITEM

BEGIN Change Received Customer Enter Cash Tendered IF Cash tendered is < total Price THEN Display Error Message Else Display change Received End IF END Change Received

[Type text]

Page 18

Screen Layout

Desk Check
Password PASS 2 1 2 3 Password PASS 1 1 [Type text] Abc Page 19 Conditio n Output 123 If password is f Display Error Condition Output

If passwor d is T Display Main Screen Barcode Conditio n Item Name Item cost Total Cost Item Count Output

Pass 1 1 2 3 4 5 6 Barcode Conditio n Item Name Item cost Total Cost Item Count Output 01 Apple 3.00 3.00 1 Apple $3.00 $10.00 1

Pass 2 1 2 3 4 5 6 Password Desk Check 31 Barcode invalid Error Error Error Error Error

Main Desk check [Type text]

Page 20

Barcode Pass1 1 2 3 4 05

Item Name

Buy Price

Sell Price

Condition

Output

Mango 5.00 7.00

Pass2 1 2 3 4 5 05 Mango 10.00 9.00 If sell price < buy price Error

Edit Item Desk Check Barcode Pass 1 1 2 3 4 Pass 2 1 2 3 4 [Type text] 07 Pears 6.00 7.00 Page 21 Barcode entered exist Item name entered exist Error Error 6.00 7.00 Barcode entered exist Item name entered exist Error Error Item Name Buy Price Sell Price Condition Output

Update Item Desk check

[Type text]

Page 22

Total Cost Pass 1 1 2 3 4 5 Total Cost Pass 1 1 2 3 50 50

Cash Tendered

Change Received

Condition

Output

60 10

Cash Tendered

Change Received

30 Cash tendered < total price Display Error

4 5 Transaction Desk Check

[Type text]

Page 23

Code
Note: I acknowledge that not all the code used in developing this solution is ours. It is all for commercial and entertainment purposes. ADD ITEM
Public Class AddItem ' used to tell the main window that the operation is cancelled Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.DialogResult = Windows.Forms.DialogResult.Cancel End Sub ' used to insert the item Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' perform validation for barcode If TextBox1.Text.Trim = "" Then MsgBox("You should enter a barcode number", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox1.Focus() Exit Sub End If If Not IsNumeric(TextBox1.Text) Then MsgBox("The barcode number should include digits only", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox1.Focus() Exit Sub End If If TextBox1.Text.Contains(".") Or TextBox1.Text.Contains("-") Then MsgBox("The barcode number should include digits only", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox1.Focus() Exit Sub End If ' perform check for the item name If TextBox2.Text.Trim = "" Then MsgBox("You should enter name for the item", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox2.Focus() Exit Sub End If ' perform a check for the buy price If Not IsNumeric(TextBox3.Text) Then MsgBox("You should enter the buy price as a number", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox3.Focus() Exit Sub End If Dim BuyPrice As Decimal = Decimal.Parse(TextBox3.Text) If BuyPrice < 0 Then MsgBox("Buy price can't be negative", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error")

[Type text]

Page 24

TextBox3.Focus() Exit Sub End If ' perform a check for the sell price If Not IsNumeric(TextBox4.Text) Then MsgBox("You should enter the sell price as a number", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox4.Focus() Exit Sub End If Dim SellPrice As Decimal = Decimal.Parse(TextBox4.Text) If SellPrice < 0 Then MsgBox("Sell price can't be negative", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox4.Focus() Exit Sub End If If SellPrice <= BuyPrice Then MsgBox("Sell price can't be less than buy price", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox4.Focus() Exit Sub End If ' insert the item Try ' create the adapter Dim TA As New POSDSTableAdapters.ItemsTableAdapter ' insert the item TA.Insert(TextBox1.Text, TextBox2.Text, BuyPrice, SellPrice) ' close window and return ok Me.DialogResult = Windows.Forms.DialogResult.OK Catch ex As Exception ' display error message MsgBox(ex.Message, MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly,

"Error")

End Try End Sub Private Sub AddItem_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class

[Type text]

Page 25

EDIT ITEM
Public Class EditItem ' this method is used to fill the information Public Sub FillItemInfo(ByVal Barcode As String) ItemsTA.FillByBarcode(MyDS.Items, Barcode) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.DialogResult = Windows.Forms.DialogResult.Cancel End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' perform validation for barcode If TextBox1.Text.Trim = "" Then MsgBox("You should enter a barcode number", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox1.Focus() Exit Sub End If If Not IsNumeric(TextBox1.Text) Then MsgBox("The barcode number should include digits only", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox1.Focus() Exit Sub End If If TextBox1.Text.Contains(".") Or TextBox1.Text.Contains("-") Then MsgBox("The barcode number should include digits only", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox1.Focus() Exit Sub End If ' perform check for the item name If TextBox2.Text.Trim = "" Then MsgBox("You should enter name for the item", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox2.Focus() Exit Sub End If ' perform a check for the buy price If Not IsNumeric(TextBox3.Text) Then MsgBox("You should enter the buy price as a number", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox3.Focus() Exit Sub End If Dim BuyPrice As Decimal = Decimal.Parse(TextBox3.Text) If BuyPrice < 0 Then MsgBox("Buy price can't be negative", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox3.Focus() Exit Sub End If ' perform a check for the sell price If Not IsNumeric(TextBox4.Text) Then

[Type text]

Page 26

MsgBox("You should enter the sell price as a number", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox4.Focus() Exit Sub End If Dim SellPrice As Decimal = Decimal.Parse(TextBox4.Text) If SellPrice < 0 Then MsgBox("Sell price can't be negative", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox4.Focus() Exit Sub End If If SellPrice <= BuyPrice Then MsgBox("Sell price can't be less than buy price", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox4.Focus() Exit Sub End If ' insert the item Try ' create the adapter Dim TA As New POSDSTableAdapters.ItemsTableAdapter ' insert the item BS.EndEdit() TA.Update(MyDS.Items) ' close window and return ok Me.DialogResult = Windows.Forms.DialogResult.OK Catch ex As Exception ' display error message MsgBox(ex.Message, MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") End Try End Sub

End Class

CHANGE PASSWORD
Public Class ChangePassword ' user cancels psw change Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.DialogResult = Windows.Forms.DialogResult.Cancel End Sub ' user wants to change password Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try ' validate the new password If TextBox2.Text = "" Then MsgBox("You should enter a password", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox2.Focus()

[Type text]

Page 27

Exit Sub End If If TextBox2.Text <> TextBox3.Text Then MsgBox("The password does not match its confirmation", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox2.Focus() Exit Sub End If ' get the original password Dim TA As New POSDSTableAdapters.ValuesTableAdapter Dim DB = TA.GetDataByKey("password") Dim DBPSW As String = DB.Rows(0).Item(1) If DBPSW <> TextBox1.Text Then MsgBox("The old password is incorrect", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox1.Focus() Exit Sub End If in the db ' everything went well, so we are going to update the password

Dim Rc As Integer = TA.UpdateDbVar(TextBox2.Text, "password") If Rc = 0 Then MsgBox("Password not updated", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") Exit Sub End If Me.DialogResult = Windows.Forms.DialogResult.OK Catch ex As Exception ' handle the error MsgBox(ex.Message, MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, Exit Sub End Try End Sub End Class

"Error")

PASSWORD PICKER
Public Class ChangePassword ' user cancels psw change Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.DialogResult = Windows.Forms.DialogResult.Cancel End Sub ' user wants to change password Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try ' validate the new password

[Type text]

Page 28

If TextBox2.Text = "" Then MsgBox("You should enter a password", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox2.Focus() Exit Sub End If If TextBox2.Text <> TextBox3.Text Then MsgBox("The password does not match its confirmation", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox2.Focus() Exit Sub End If ' get the original password Dim TA As New POSDSTableAdapters.ValuesTableAdapter Dim DB = TA.GetDataByKey("password") Dim DBPSW As String = DB.Rows(0).Item(1) If DBPSW <> TextBox1.Text Then MsgBox("The old password is incorrect", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") TextBox1.Focus() Exit Sub End If in the db ' everything went well, so we are going to update the password

Dim Rc As Integer = TA.UpdateDbVar(TextBox2.Text, "password") If Rc = 0 Then MsgBox("Password not updated", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") Exit Sub End If Me.DialogResult = Windows.Forms.DialogResult.OK Catch ex As Exception ' handle the error MsgBox(ex.Message, MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, Exit Sub End Try End Sub End Class

"Error")

[Type text]

Page 29

MAIN
Public Class MainWindow ' the form loads and initialization should happen Private Sub MainWindow_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try ' get the password from the user Dim PSWWin As New PasswordPicker

' if the user hits the exit button then stop execution If PSWWin.ShowDialog <> Windows.Forms.DialogResult.OK Then End End If ' get the password Dim PSW As String = PSWWin.TextBox1.Text ' get the password from the database Dim TA As New POSDSTableAdapters.ValuesTableAdapter Dim TB = TA.GetDataByKey("password") Dim DBPSW As String = TB.Rows(0).Item(1) ' check that passwords match If PSW <> DBPSW Then MsgBox("Wrong Password Moron", MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") End End If ' load the items information from db into the dataset ItemsTA.Fill(MyDataset.Items) Catch ex As Exception ' handle the error MsgBox(ex.Message, MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, End End Try End Sub ' change the password Private Sub ChangePasswordToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChangePasswordToolStripMenuItem.Click Dim PSWChange As New ChangePassword PSWChange.ShowDialog() End Sub ' add item to the db

"Error")

[Type text]

Page 30

Private Sub AddItemToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddItemToolStripMenuItem.Click Dim AddItemWindow As New AddItem If AddItemWindow.ShowDialog = Windows.Forms.DialogResult.OK Then ' load the information of items from db ItemsTA.Fill(MyDataset.Items) End If End Sub ' used to select an item Private Sub EditItemToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EditItemToolStripMenuItem.Click ' make sure an item is selected If DGV.SelectedRows.Count = 0 Then Exit Sub End If ' get the barcode of the item Dim Barcode = DGV.SelectedRows(0).Cells(0).Value ' create the edit window Dim EditItemWindow As New EditItem ' fill the window with information EditItemWindow.FillItemInfo(Barcode) If EditItemWindow.ShowDialog = Windows.Forms.DialogResult.OK Then ' load the information of items from db ItemsTA.Fill(MyDataset.Items) End If End Sub ' this one is used to remove an item Private Sub RemoveItemToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RemoveItemToolStripMenuItem.Click ' make sure a single item is being selected If DGV.SelectedRows.Count = 0 Then Exit Sub End If ' get the barcode of the item Dim Barcode As String = DGV.SelectedRows(0).Cells(0).Value ' remove the item Try ItemsTA.DeleteByBarcode(Barcode) ItemsTA.Fill(MyDataset.Items) Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") End Try End Sub ' checks if the return key is pressed

[Type text]

Page 31

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If Button1.Enabled Then If e.KeyChar = Chr(13) Then Button1_Click(Nothing, Nothing) End If End If End Sub ' this one is used to detect the barcode item when the text change and display its information Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged Try ' step 01: create the table adapter Dim TA As New POSDSTableAdapters.ItemsTableAdapter Dim TB = TA.GetDataByBarcode(TextBox1.Text) ' step 02: check if no item is found If TB.Rows.Count = 0 Then TextBox2.Text = "" TextBox3.Text = "" Button1.Enabled = False Exit Sub End If ' step 03: display the information in the textboxes Button1.Enabled = True Dim R As POS.POSDS.ItemsRow = TB.Rows(0) TextBox2.Text = R.ItemName TextBox3.Text = R.SellPrice Button1.Tag = R Catch ex As Exception ' display error message MsgBox(ex.Message, MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") End Try End Sub

' this will be used to add an item to the recipt details Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' get the details of the item Dim R As POS.POSDS.ItemsRow = Button1.Tag ' next search for the barcode in the datagridview Dim I As Integer Dim ItemLoc As Integer = -1 For I = 0 To DGV2.Rows.Count - 1 If R.Barcode = DGV2.Rows(I).Cells(0).Value Then ' item found ItemLoc = I Exit For Next End If

[Type text]

Page 32

' if item is not found, add it If ItemLoc = -1 Then DGV2.Rows.Add(R.Barcode, R.ItemName, R.BuyPrice, R.SellPrice, 1, R.SellPrice) Else ' if item is already there increase its count Dim ItemCount As Long = DGV2.Rows(ItemLoc).Cells(4).Value ItemCount += 1 Dim NewPrice As Decimal = R.SellPrice * ItemCount DGV2.Rows(ItemLoc).Cells(4).Value = ItemCount DGV2.Rows(ItemLoc).Cells(5).Value = NewPrice End If ' next clear textbox1 and set focus to it TextBox1.Text = "" TextBox1.Focus() ' compute the total for the recipt Dim Sum As Decimal = 0 For I = 0 To DGV2.Rows.Count - 1 Sum += DGV2.Rows(I).Cells(5).Value Next TextBox4.Text = Sum TextBox5.Text = Sum

End Sub ' remove item from the recipt Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If DGV2.SelectedRows.Count = 0 Then Exit Sub End If DGV2.Rows.Remove(DGV2.SelectedRows(0)) End Sub ' save the recipt Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim MyConnection As OleDb.OleDbConnection = Nothing Dim MyTransaction As OleDb.OleDbTransaction = Nothing Try ' create the connection and transaction object MyConnection = New OleDb.OleDbConnection(My.Settings.dbConnectionString) MyConnection.Open() MyTransaction = MyConnection.BeginTransaction ' insert the new recipt Dim SQL As String = "insert into recipts (reciptdate,recipttotal) values (:0,:1)" Dim CMD1 As New OleDb.OleDbCommand

[Type text]

Page 33

CMD1.Connection = MyConnection CMD1.Transaction = MyTransaction CMD1.CommandText = SQL CMD1.Parameters.AddWithValue(":0", Now.Date) CMD1.Parameters.AddWithValue(":1", TextBox4.Text) CMD1.Parameters.AddWithValue(":1", TextBox5.Text) CMD1.ExecuteNonQuery() CMD1.Dispose() ' get the id for the recipt SQL = "select max(reciptid) as MAXID from recipts" Dim CMD2 As New OleDb.OleDbCommand CMD2.Connection = MyConnection CMD2.Transaction = MyTransaction CMD2.CommandText = SQL Dim ReciptID As Long = CMD2.ExecuteScalar() CMD2.Dispose() ' insert the details of the recipt Dim I As Integer For I = 0 To DGV2.Rows.Count - 1 ' get the values Dim Barcode As String = DGV2.Rows(I).Cells(0).Value Dim BuyPrice As Decimal = DGV2.Rows(I).Cells(2).Value Dim SellPrice As Decimal = DGV2.Rows(I).Cells(3).Value Dim ItemCount As Integer = DGV2.Rows(I).Cells(4).Value ' next create a command Dim CMD3 As New OleDb.OleDbCommand SQL = "insert into ReciptDetails " & _ "(reciptid,barcode,itemcount,itembuyprice,itemsellprice) " & _ "values " & _ "(:0 ,:1 ,:2 ,:3 ,:4 CMD3.Connection = MyConnection CMD3.Transaction = MyTransaction CMD3.CommandText = SQL CMD3.Parameters.AddWithValue(":0", ReciptID) CMD3.Parameters.AddWithValue(":1", Barcode) CMD3.Parameters.AddWithValue(":2", ItemCount) CMD3.Parameters.AddWithValue(":3", BuyPrice) CMD3.Parameters.AddWithValue(":4", SellPrice) CMD3.ExecuteNonQuery() CMD3.Dispose() Next ' all well save the changes MyTransaction.Commit() ' close connection MyTransaction.Dispose() MyConnection.Close() MyConnection.Dispose() DGV2.Rows.Clear() TextBox4.Text = "" TextBox5.Text = ""

)"

[Type text]

Page 34

Catch ex As Exception If MyTransaction IsNot Nothing Then MyTransaction.Rollback() End If If MyConnection IsNot Nothing Then If MyConnection.State = ConnectionState.Open Then MyConnection.Close() End If End If MsgBox(ex.Message, MsgBoxStyle.Critical Or MsgBoxStyle.OkOnly, "Error") End Try

End Sub Private Sub Button4_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim Number1 As Integer Dim Number2 As Integer Dim Answer As Integer Number1 = TextBox5.Text Number2 = TextBox7.Text Answer = TextBox7.Text - TextBox5.Text MessageBox.Show(Answer, "Your Change is") End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click End End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click TextBox6.Text = "" TextBox7.Text = "" End Sub Private Sub TableLayoutPanel1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) End Sub End Class

[Type text]

Page 35

Test Plan
We have developed a cash register program which allows a barcode to be inputted form the keyboard and the product price and description will be displayed on the screen. Once all items have been entered, the amount due will be displayed. An appropriate message will be displayed when the entered barcode does not have a product associated with it. The program will accept an amount tendered by the customer and calculate the change due. The product description file will contain at least twenty different products. Since we have completed our solution, the code needs to be tested. This stage is similar to the desk-checking stage. The major difference is that we test the coded program on computer rather than using pencil and paper and manually performing the testing. The Product list has been created and the layout has been set out. Since this is a cash register program it easy to use, has fewer components, basic functions and reporting, improves accuracy, easily grows with the business and a better track inventory. The purpose of testing data is to test the relevant parts of the solution. This is to ensure that the solution does what is required of it. Dummy data consisting of a number of test customers together with a variety of test orders is created. The test data is structured in such a way as to test the limits of the cash register. So we will set the limits from a minimum of $5 to a maximum of $1000. These data includes orders that are both below and above this range, as well as falling within the range. Test data outside of the range should generate appropriate messages. Test data within the range should result in orders being processed correctly. The boundary values (in this case $10 and $1000) are also included to test whether the program performs the correct processing when these items are encountered. Other test data is used to test the database entries. For example, in the barcode field anything other than integers should generate an error message. As seen below.

Below is an example of the test which see`s if the solution is working perfectly. As you can see appropriate

[Type text]

Page 36

data types have been inputted to ensure that the solution works without any errors.

Improvement: User Friendly Easy to use interface More appealing look Layout Different Languages Basic functions and reporting Improves accuracy Printing a Daily Report

[Type text]

Page 37

Documentation
Welcome USERS Congratulations upon your selection of this magnificent cash register, which is designed to provide years of reliable operation. Operating of this cash register is simple enough to be mastered without special training. Everything you need to know is included in this manual, so keep it on hand for reference. Consult your Cash Register dealer if you have any questions about points not specifically covered in this manual. Functional Description This software will allow a barcode to be inputted form the keyboard and the product price and description will be displayed on the screen. Once all items have been entered, the amount due should be displayed. An appropriate message will be displayed when the entered barcode does not have a product associated with it. The program will accept an amount tendered by the customer and calculate the change due. The product description file will contain at least twenty different products. General Guide

This part of the manual introduces you to the cash register and provides a general explanation of its various parts.

[Type text]

Page 38

Roll Paper: you can use the roll paper to print receipts and a journal Mode Key: there are two types of mode keys: the program key and the operator key. The program key can be used to set the mode switch to any position. Drawer: the drawer open automatically whenever you finalize a registration and whenever you issue a read or reset report. Magnetic Plate: use this plate for tacking the notes received from customer.

System installation

Setting up your cash register consists of the following steps: Plugging in and Putting in the Batteries Installing the Paper Roll Setting the Date and Time Programming the Sales Tax Setting at least 2 Department Keys
Plugging in and Putting in the Batteries 1. Make sure that you plug the cash register into the electrical outlet before you put in the batteries. To get the cash register ready to use 1. Remove the cash register and the parts from the box. Store the box and packing material in a safe, dry place. If you need to move the register in the future, you can put it back in the box. 2. Remove the tape holding the parts of the cash register in place. For example, there may be tape on the back of the Journal Compartment Cover. 3. Put the register on a hard, level surface, away from rain and spilled drinks. A hard level surface makes it easier for the cash drawer to go in and out smoothly. Do not put the register on a porous surface. Depending on the surface or any cleaning solution used on the surface, the rubber feet may leave marks on the surface. Do not place the register on any valuable surface, such as antique or fine wood tables, desks, and so on. 4. Plug the cash register into a standard three-hole electrical wall outlet. (115-120 volt, 60 hertz). Make sure the electrical cord is not going to get tripped over or accidentally pulled from the electrical outlet. Put the cash register on an electrical circuit with no other electrical device or appliance. Other appliances can overload the circuit or cause electrical interference with the cash register. It is best that you use a circuit without other appliances already on it. 5. Install the memory backup batteries. a. Open the Journal Compartment cover. Unlock the compartment cover with the Cash Drawer/Journal Lock key #515. Grip the left side of the journal cover and gently pull upward. Remove the cover and put it aside. [Type text] Page 39

b. Remove the battery cover, located in the rear left section of the compartment. Press the indentation at the bottom of the cover and slide up. See the graphic to the right for details. c. Put the batteries in the slots. Make sure that the positive and negative ends are in the right place. The batteries have a little plus (positive) and minus (negative) sign on each end to help you. d. Replace the battery cover by sliding it back down into position. e. Now you are ready to put the paper in the cash register and set the time and the date. See the next section for more information.

Trouble Shooting Guide This section describes what to do when you have problems with operation.

When an error occurs Errors are indicated by an error codes. When this happen, you can usually find out what the problem is as illustrated below.

[Type text]

Page 40

In Case of Power Failure


If the power supply to the cash register is cut by a power failure or any other reason, simply wait for power to be restored. The details of any ongoing transaction as well as all sales data in memory are protected by the memory backup batteries.

[Type text]

Page 41

Power failure during a registration. The subtotal for items registered up to the power failure is retained in memory. You will be able to continue with the registration when power is restored. Power failure during printing a read/reset report. The data already printed before the power failure is retained in memory. You will be able to issue a report when power is restored. The power failure symbol is printed and any item that was being printed when the power failure occurred is reprinted in full.

Online Help For any other question please follow the website or give us a call: Website: www.cashregister.com.au Phone Number: 1300 400 500

[Type text]

Page 42

Evaluation of the solution


Checking the solution to see if it meets the original design specification The solution meets the original design specification. The initial Cash Register is user friendly and easy to use. This cash register is a way to testing the easiness and the function of the Cash Register. There are many benefits of having a user friendly cash register. Close comparisons will be made between each transaction to see how fast the cash register works. The Cash Register will be economical so many small businesses have the opportunity to buy the software which will help save money. The design of the solution is very easy and user friendly, even kids could operate it. The database of the product will need to be done using non computer tool which will be than put inside the database. User feedback Following are some comments by the customers who bought our Cash Register: 5.0 out of 5 star Great for Market! We are a small family run farm and we go to farmer's markets every weekend plus we open up our farm for visitors and such. I needed something portable and within our very limited price range. Best thing is the wonderful job it does on taxes! We have food items which are a totally different price than our nonfood items and now I don't have to go a bunch of extra steps... Read the full review Great register. I've had 3 of these over the past 20 years. Recommend this to anyone who needs a portable register. Great for people who do outside trade shows with no electricity.

Social and ethical perspectives Our software is easy to use. The software is designed to avoid the use of technical language. We have used some existing code in our software to build the solution. We know that we dont own everything; the software is for commercial purposes. Since the software is the link between the computer and the operator there is many ergonomically specs designed to make the operator feel relaxed and comfortable. Page 43

[Type text]

For example, the choice of text and background colours can mean the difference between customers persisting. The Program is more visually pleasant sight. A common trend in Cash Register is the use of red text on a black background. This combination is actually quite hard on the eyes and Web developers have moved to a more natural white background with black text. Good use of white space also helps enhance the legibility of the page.

[Type text]

Page 44

Conclusion
As a group of four, we chose the supermarket problem; a supermarket cash register was simulated. A barcode was imputed from the keyboard, and the product price and description were displayed on the screen. Once all items were entered, the amount due was displayed. An appropriate message was displayed when an entered barcode did not have a product associated with it. The program accepted an amount tendered by the customer and calculated the change due. The product description file contained at least twenty different products and the contents discussed in this report included: 1. Title page, documenting group members names, due date and class. 2. Contents page 3. A brief introduction of the report. 4. A problem statement, which states what you will try to solve and the scope of your problem. 5. Gantt Chart listing the tasks to be completed, when they are due and who will need to complete it 6. A list of all the subroutines and what will occur 7. An Input, Process, Output (IPO) chart for all subroutines 8. Data dictionary of the solution 9. Data Flow Diagram of the solution (DFD) 10. Storyboard of the software solution 11. System flowchart of the solution 12. Algorithm of the solution 13. Screen layout of the solution 14. Desk check of the solution 15. The actual code of the solution (copied from VB) 16. Test plan, outlining how you will test the solution and its results 17. Explanation of the type of documentation that will need to be produced to accompany your solution 18. Evaluation of the solution, including involvement of those 19. Conclusion of the report 20. Formatting and Presentation of report

[Type text]

Page 45

Our group has successfully created a report on a chosen problem. Our chosen problem was the Supermarket Cash Register. The report that our team created has provided us with great opportunity to know about the various aspects and stages of developing a Software Solution for the problem. Apart from imparting theoretical knowledge, this report has helped us improve our practical knowledge about developing a Software Solution. We learnt a lot of information about how to develop an Software Solution. We got both theoretical as well as practical knowledge about developing a Software Solution and various stages in developing a Software Solution. By writing this report on developing Software Solution we have gained abundance knowledge and hope it will help us in our future studies. As a group we have achieved what set out to achieve. Overall we are proud of what we have achieved and gained through this assessment.

[Type text]

Page 46

You might also like