|
-
Nov 1st, 2014, 05:25 PM
#1
Thread Starter
Junior Member
Spacing Help!
I am not good at spacing my program. I have my program spaced like this:

With these numbers:
Console.WriteLine(AUTHOR & vbNewLine)
Console.WriteLine(Space(24) & HEAD1 & vbNewLine & Space(15) & _
HEAD2 & vbNewLine & Space(13) & LINE)
If Not File.Exists(Diskfile) Then
Console.WriteLine("File: " & Diskfile & " does not exist")
Console.WriteLine(vbNewLine & vbNewLine) : Exit Sub : End If
FileOpen(1, Diskfile, OpenMode.Input)
While Not EOF(1)
Tokens = New StringTokenizer(LineInput(1), Delimiter)
Name = Tokens.NextToken() & " " & Tokens.NextToken()
Name = Name.PadRight(15)
hours = Tokens.NextToken()
payRate = Tokens.NextToken()
grossPay = CalculateGrossPay(hours, payRate)
pension = CalculatePension(hours, payRate)
netPay = grossPay - pension
totalHours = totalHours + hours
totalGrossPay = totalGrossPay + grossPay
totalPension = totalPension + pension
totalNetPay = totalNetPay + netPay
Console.Write(Space(16) & Name)
Console.Write(Space(8) & "{0:F2}", hours)
Console.WriteLine(Space(5) & "{0:F2}", payRate)
Console.WriteLine(Space(5) & "{0:F2}", grossPay)
Console.WriteLine(Space(5) & "{0:F2}", pension)
Console.WriteLine(Space(5) & "{0:F2}", netPay)
End While
FileClose(1)
Console.Write(Space(5) & LINE & vbCrLf & Space(14) & "TOTALS:")
Console.Write(Space(6) & "{0:F2}", totalhours)
Console.Write(Space(13) & "{0:F2}", totalGrossPay)
Console.Write(Space(9) & "{0:F2}", totalPension)
Console.Write(Space(10) & "{0:F2}", totalNetPay)
Console.Write(Space(27) & LINE & vbCrLf & vbCrLf)
End Sub 'Main()
I need it spaced to look like this:
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|