Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Program Name: WK12- Project 2: JM Sales
- 'AUTHOR: STONEBONETHONE
- 'DATE: 19 November, 2017
- 'OVERVIEW: Program calculates user entered sales made by 5 employees, who all have a salesID
- 'The ID and total sales of the employee are calculated and displayed in a results textbox (edit)
- Option Explicit On
- Option Infer Off
- Option Strict On
- Public Class Form1
- 'This is the array for the sales made
- Dim salesMade(4) As Decimal
- Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
- salesIDListBox.Items.Add("101")
- salesIDListBox.Items.Add("112")
- salesIDListBox.Items.Add("203")
- salesIDListBox.Items.Add("301")
- salesIDListBox.Items.Add("302")
- End Sub
- Private Sub addToTotalButton_Click(sender As Object, e As EventArgs) Handles addToTotalButton.Click
- Dim sales As Decimal
- 'This will convert the enter tbox text to decimals
- Decimal.TryParse(enterSalesTextBox.Text, sales)
- 'This will add to the sales in each array element, correspodning to the listbox indexes
- salesMade(salesIDListBox.SelectedIndex) += sales
- End Sub
- Private Sub CreateTheReport(sender As Object, e As EventArgs) Handles createReportButton.Click
- 'Parts of the loop used for cycling through each array element and item
- Dim highestSub As Integer = salesMade.GetUpperBound(0)
- Dim subscript As Integer = 0
- 'Convert the array elements to strings
- salesMade
- 'Here each element of the array must be cycled through, and the elements & items printed
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement