以下のプログラムの最後に生成されるテーブルを.txtに保存して、後日振り返ることができるようにするオプションを探していますが、これを実現するのに苦労しています。
Module Module1
Dim kTick As Integer
Dim kName(64) As String
Dim kHours(64) As Integer
Dim kHoursPay(64) As Integer
Dim kGross(64) As Integer
Dim kTax As Integer = 20
Dim kNet(64) As Integer
Dim kTotal As Integer
Dim kAverage As Integer
Sub Main()
'Assigning kTick (Number of employee's)
Assign()
'Imputting the data
Entry()
'Calculating kGross, kTax, kNet and kTotal
Print()
End Sub
Sub Assign()
Console.ForegroundColor = ConsoleColor.Gray
Console.WriteLine("Please enter the total amount of employee's:")
Console.ForegroundColor = ConsoleColor.White
kTick = Console.ReadLine()
Console.Clear()
End Sub
Sub Entry()
For kCounter = 1 To kTick
Console.ForegroundColor = ConsoleColor.DarkGray
Console.WriteLine("Employee " & kCounter)
Console.ForegroundColor = ConsoleColor.Gray
Console.WriteLine("Please enter the employee name below:")
Console.ForegroundColor = ConsoleColor.White
kName(kCounter) = Console.ReadLine()
Do
Console.ForegroundColor = ConsoleColor.Gray
Console.WriteLine("Please enter the employees total hours worked below:")
Console.ForegroundColor = ConsoleColor.White
kHours(kCounter) = Console.ReadLine()
Loop Until kHours(kCounter) >= 0 And kHours(kCounter) <= 60
Do
Console.ForegroundColor = ConsoleColor.Gray
Console.WriteLine("Please enter the employees Hourly Pay below:")
Console.ForegroundColor = ConsoleColor.White
kHoursPay(kCounter) = Console.ReadLine()
Loop Until kHoursPay(kCounter) >= 6 And kHoursPay(kCounter) <= 250
Console.Clear()
Next
End Sub
Sub Print()
For kCounter = 1 To kTick
kGross(kCounter) = kHours(kCounter) * kHoursPay(kCounter)
Next
For kCounter = 1 To kTick
kNet(kCounter) = (kGross(kCounter) / 10) * 8
Next
For kCounter = 1 To kTick
kTotal = kTotal + kHours(kCounter)
Next
kAverage = kTotal / kTick
Console.ForegroundColor = ConsoleColor.Gray
Console.WriteLine("Name" & vbTab & "Hours" & vbTab & "Hourly Rate" & vbTab & "Gross Pay" & vbTab & "Tax" & vbTab & "Net Pay")
Console.ForegroundColor = ConsoleColor.White
For kCounter = 1 To kTick
Console.WriteLine(kName(kCounter) & vbTab & kHours(kCounter) & vbTab & "£" & kHoursPay(kCounter) & vbTab & vbTab & "£" & kGross(kCounter) & vbTab & vbTab & kTax & "%" & vbTab & "£" & kNet(kCounter))
Next
Console.ForegroundColor = ConsoleColor.Gray
Console.WriteLine("Total hours worked: " & kTotal)
Console.WriteLine("Total average hours worked: " & kAverage)
Console.WriteLine("Total number of employees: " & kTick)
Console.ReadLine()
Save()
End Sub
Sub Save()
End Sub
End Module
Saveサブルーチンのコードを取得しようとしていますが、助けていただければ幸いです。
ありがとうカイ