Answer:
In Python:
fname = input("Filename: ")
a_file = open(fname)
lines = a_file.readlines()
print("Name\t\tHours\t\tTotal Pay")
for line in lines:
eachline = line.rstrip(" ")
for cont in eachline:
print(cont,end="\t")
print()
Explanation:
This prompts the user for file name
fname = input("Filename: ")
This opens the file
a_file = open(fname)
This reads the lines of the file
lines = a_file.readlines()
This prints the header of the report
print("Name\t\tHours\t\tTotal Pay")
This iterates through the content of each line
for line in lines:
This splits each line into tokens
eachline = line.rstrip(" ")
This iterates through the token and print the content of the file
for cont in eachline:
print(cont,end="\t")
print()