```
Private Sub Command1_Click()
Dim a, b, cc As Integer
Dim p(3), d(3), e(3), t(3), h(3), w(3), c(3), f(6) As Integer
If Text4.Text <> "" Then
strfile = Text4.Text
Open strfile For Input As #1
For i = 1 To 3
Input #1, p(i), d(i), h(i), w(i)
Next i
Close #i
For i = 1 To 3
p(i) = CInt(InputBox("enter pros.tj " & CStr(i), "prosseng time for job"))
d(i) = CInt(InputBox("enter due date " & CStr(i), "due date for job"))
h(i) = CInt(InputBox("enter cost ear " & CStr(i), "cost of earlness"))
w(i) = CInt(InputBox("enter weigh " & CStr(i), "weigh of job"))
Next i
Open "c:\machineporb.text" For Output As #2
For i = 1 To 3
Print #2, p(i); d(i); h(i); w(i)
Next i
Close #2
End If
For i = 1 To 3
c(i) = 0
e(i) = 0
t(i) = 0
Next i
For i = 1 To 3
If i <> 1 Then c(i) = c(i - 1) + p(i)
If i = 1 Then c(i) = p(i)
Next i
For i = 1 To 3
If (d(i) - c(i)) > 0 Then
e(i) = d(i) - c(i)
If (c(i) - d(i)) > 0 Then
t(i) = c(i) - d(i)
Next i
a = 10
For i = 1 To 3
f(i) = h(i) * (d(i) - p(i))
If f(i) < a Then
a = f(i)
Text1.Text = CStr(i)
End If
Next i
a = f(1) + (h(2) * e(2)) + (w(2) * t(2))
b = f(2) + (h(1) * e(1)) + (w(1) * t(1))
If a > b Then f(4) = b
If b > a Then f(4) = a
a = f(1) + (h(3) * e(3)) + (w(3) * t(3))
b = f(3) + (h(1) * e(1)) + (w(1) * t(1))
If a > b Then f(5) = b
If b > a Then f(5) = a
Text2.Text = "12"
a = f(2) + (h(3) * e(3)) + (w(3) * t(3))
b = f(3) + (h(2) * e(2)) + (w(2) * t(2))
If a > b Then f(6) = b
If b > a Then f(6) = a
a = f(4) + (h(3) * e(3)) + (w(3) * t(3))
b = f(5) + (h(2) * e(2)) + (w(2) * t(2))
cc = f(6) + (h(1) * e(1)) + ((w1) * t(1))
If (b > a) And (cc > a) Then f(7) = a
Text3.Text = "213"
If (a > b) And (cc > b) Then f(7) = b
Text3.Text = "321"
If (cc > b) And (a > cc) Then f(7) = cc
Text3.Text = "123"
If b > a Then f(6) = a
End Sub
Private Sub Command2_Click()
st = InputBox("åá ÊÑíÏ ÍÝÙ ÇáÈíÇäÇÊ")
Open st For Output As #1
Open "c:\machineprob.txt" For Input As #2
While Not EOF(2)
Input #2, st
Print #1, st
End While
Close()
MsgBox("Êã ÇáÍÝÙ")
End Sub
```

0

*Edited
by Reverend Jim*: Fixed formatting