Shahezad Contractor
Professor Erahimi

Last Class Review


Sort can be found in PAGE 157.

I give you a bunch of cards in front of you. sort them.  You look at the first one and then you look at the second one and you compare them.

 

Sample Final

You to design a payroll software from scratch according to the following steps. For more information read the case study phase 5. Each step will be graded separately and has 10 points.

STEP1) Design a form with your company name with the command button called payroll. output will be displayed in any of your choices (textbox, label, list  or even picture box) with corresponding labels according to the case study.

STEP2) Program the button to display only the input data 

STEP3) display only Input data with gross pay

STEP4) Display only input data with regular pay and overtime pay

STEP5) display tax rate

step6) display taxrate according to the marital status

step7 ) display tax amout

step8) display netpay

step 9) search for an employee

step 10) sort and search for an employee

 

Public Class Form1

Inherits System.Windows.Forms.Form

Dim table() As Integer = {55, 1, 3, 99, 8, 12, 7, 8, 14}

Dim n As Integer = 9

Dim i As Integer = 0

Dim j As Integer

Dim hold As Integer

 

#Region " Windows Form Designer generated code "

Public Sub New()

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

If disposing Then

If Not (components Is Nothing) Then

components.Dispose()

End If

End If

MyBase.Dispose(disposing)

End Sub

'Required by the Windows Form Designer

Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

Friend WithEvents Button1 As System.Windows.Forms.Button

Friend WithEvents Button2 As System.Windows.Forms.Button

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

Me.Button1 = New System.Windows.Forms.Button

Me.Button2 = New System.Windows.Forms.Button

Me.SuspendLayout()

'

'Button1

'

Me.Button1.Location = New System.Drawing.Point(104, 64)

Me.Button1.Name = "Button1"

Me.Button1.Size = New System.Drawing.Size(80, 23)

Me.Button1.TabIndex = 1

Me.Button1.Text = "DISPLAY"

'

'Button2

'

Me.Button2.Location = New System.Drawing.Point(104, 120)

Me.Button2.Name = "Button2"

Me.Button2.TabIndex = 2

Me.Button2.Text = "SORT"

'

'Form1

'

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Me.ClientSize = New System.Drawing.Size(292, 190)

Me.Controls.Add(Me.Button2)

Me.Controls.Add(Me.Button1)

Me.Name = "Form1"

Me.Text = "Form1"

Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

For i = 0 To n - 1

MsgBox("Your data is " & table(i))

Next i

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

For j = 0 To n - 1

For i = 0 To n - 2

If table(i) > table(i + 1) Then

hold = table(i)

table(i) = table(i + 1)

table(i + 1) = hold

End If

Next

Next

End Sub

End Class