1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Naya [18.7K]
3 years ago
15

The Payroll Department keeps a list of employee information for each pay period in a text file. The format of each line of the f

ile is the following: Write a 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 should be in tabular forma
Computers and Technology
1 answer:
Oksi-84 [34.3K]3 years ago
5 0

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

<em> for cont in eachline: </em>

<em>  print(cont,end="\t") </em>

<em> print()</em>

You might be interested in
How do you change ip?
Fittoniya [83]
Unplug your router and plug it back in :)

Otherwise if you have a static IP contact your ISP for them to change it :D
5 0
3 years ago
Alan is developing a business impact assessment for his organization. He is working with business units to determine the maximum
jekas [21]

Answer:

A. Recovery time objective (RTO)

Explanation:

The recovery time is defined as the maximum length of time require to recover a system or any network from the failure.

Hence, to determine the recovery time of the function, one can use the RTO.

7 0
3 years ago
Oday's color display devices represent color using the ______ color model.â
12345 [234]
Mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
3 0
3 years ago
What is network hardware?
vovangra [49]
Modem, router, switch, server, etc. these are hardware meant to facilitate the transfer or storage of remote information.
8 0
3 years ago
Give examples of keyboard shortcuts and what they do/mean.
pshichka [43]
Ctrl-alt-del=opens up windows task manager
8 0
3 years ago
Other questions:
  • ________ reality is the addition of digital information directly into our reality, either to add more detail or to remove unwant
    7·1 answer
  • What is virtual memory?
    11·1 answer
  • Which leadership function involves keeping group members focused on the issue at hand?
    6·1 answer
  • What helps companies and organizations to target masses of people, provide 24/7 services, and deliver better marketing in a chea
    6·1 answer
  • Jesse wants to create a website with her company name as the address. What should she do next?
    9·1 answer
  • Which feature enables you to make changes to all the slides of your presentation at the same time?
    8·1 answer
  • Describe the effects technology, particularly computers, has had on mechanical labor.
    8·1 answer
  • What is the output of the following code<br> X = 06<br> y = 0<br> print (x ** y)
    12·1 answer
  • Websites not only give us information, but they also inspire designers in their layouts, illustrations, images, typefaces, and c
    6·1 answer
  • What is branching in Python​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!