Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Employees(8) strName R \"J\" ary Employees (e).intsalary 3 ary Employees (1) str

ID: 3814385 • Letter: E

Question

Employees(8) strName R "J" ary Employees (e).intsalary 3 ary Employees (1) strName "B" ary Employees (1) intsalary 6 'Set other array elenents here. ary Employees (15).strName "P" aryEmployees (15).intsalary 1 show the elements of the arrav. VB Project: Create a new VB project named Define a structure named Employee with variables strEmpID, strEmpName, decEmpPayRate, decEmpHours, and decEmpPay. Declare an array named EmployeesPay (with an upper subscript of 4) of Employee Datatype. o Write the VB code to write the following data on the left into a file named Employees.txt the Form load event. during Employee Data: hous Ru Employee wages 001 Mary 18.25 32.50 rei 002 Jane 21.50 29.50 $18.25 12.50 003 Mark 19.75 23.50 521.50 29.50 $15.75 23.50 004 Cynthia 21.65 35.50 Cynthia S21.65 3550 $13.25 38.50 741.13 005 Frank 19.25 38.50 Write the code to perform the following during Read button click event: Read the contents of the fileEmployees.bst into the corresponding elements of the EmployeesPay. Calculate the pay of each employee into the decEmp element of the array isplay the array elements in a listbox shown at right above. Complete the code for Clear and Exit button click events. Your completed homework should include (i) cover page, (ii) print out of answers to q (iii) print out of the completed project code with uestions, containing the completed project. appropriate comments, and (iv) your storage device

Explanation / Answer

Structure Employee
Dim strEmpId As String
Dim strEmpName As String
Dim decEmpPayRate As Double
Dim decEmpHours As Date
Dim decEmpPay As Double
End Structure

Sub read_click()
Dim EmployeePay() As Employee
Dim myfile As String
Sheet5.Cells(23, 1).Value = "Emp Id"
Sheet5.Cells(23, 2).Value = "Emp Name"
Sheet5.Cells(23, 4).Value = "Emp Rate"
Sheet5.Cells(23, 5).Value = "Emp Hours"
Sheet5.Cells(23, 6).Value = "Emp Pay"
myfile = "C:Employees.txt"
Open myfile For Input As #1
Row = 24
Do Until EOF(1)
Line Input #1, Linefromfile
Employee.strEmpId = Split(Linefromfile, " ")
Employee.strEmpName = Split(Linefromfile, " ")
Employee.decEmpPayRate = Split(Linefromfile, " ")
Employee.decEmpHours = Split(Linefromfile, " ")
Employee.decEmpay = Employee.decEmpPayRate * Employee.decEmpHours
Sheet5.Cells(Row, 1).Value = Employee.strEmpId
Sheet5.Cells(Row, 2).Value = Employee.strEmpName
Sheet5.Cells(Row, 3).Value = Employee.decEmpPayRate
Sheet5.Cells(Row, 4).Value = Employee.decEmpHours
Sheet5.Cells(Row, 5).Value = Employee.decEmpay
Row = Row + 1
Loop
listbox1.Columns = "true"
listbox1.rowsource="Sheet5.range("A23:F28").address"
Close #1
End Sub

Sub exit_click()
Unload Me
End Sub

Sub clear_click()
ListBox.rowsource = " "

End Sub

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote