Question: Write a PYTHON program that inputs a filename from the user and prints to the terminal a report of the wages paid to the employees

Write a PYTHON program that inputs a filename from the user and prints to the terminal a report of the wages paid to the employees for the given period. The report be in a tabular format with the appropriate header. Each line should contain an employees name, the hours worked, and the wages paid for that period

The input data files has been provided: data.txt

Hint:

To format the header, using the following code:

print("%-15s%6s%15s" % ("Name", "Hours", "Total Pay"))

To separate the elements (e.g., name, hourly wage, etc.) in each line, use the following code:

dataList = line.split()

The contents of the data.txt are :

Lambert 34 10.50

Osborne 22 6.25 Giacometti 5 100.70

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!