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
Anton [14]
3 years ago
14

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 format with the appropriate header.
Computers and Technology
1 answer:
user100 [1]3 years ago
8 0

Answer:

import pandas as pd

filename = input("Enter file name with the extension included: ")

data = {}

with open("filename", "r") as file:

   content = file.readlines()

   for line in content:

       line_list = line.strip().split(" ")

       data[line_list[0]] = line_list[1] * line_list[2]

       del line_list

report = pd.DataFrame(list(data.items()), columns = ["lastname", "wages paid"])

print(report)

Explanation:

The python module prompts the user for the file name and opens the text file to extract the employee data with the python open function. It iterates over the file content and saves the last name and the wages paid to the employees ( the hours worked multiplied by the hourly rate) in the dictionary "data".

The dictionary is converted to a dataframe with the Pandas python package and displays the data in tabular format on the screen.

You might be interested in
When approaching a bicyclist from the rear, you should slow down and
Veronika [31]

Answer:

A. Wait until it is safe to pass the bicyclist with at least three feet of clearance.

Explanation:

This is one of the traffic safety precautions to follow when driving especially in most parts of the United States of America.

Traffic safety guidelines are a list of Rules and instructions usually available in manuals and online made available by the government to its driving population in order to maintain law and order and prevent accidentals on the road. When effectively followed this guidelines can help to reduce accidents by a high Margin.

4 0
3 years ago
Can Word Processing (WP) programs be used for DTP? Explain your answer
siniylev [52]

Word Processing Programs cannot be used for DTP

Explanation:

DTP software cannot be replaced with Word Processing Programs.  DTP software is used for creating publishing document like post card, business card, calendars, and books where as the word processing software is used for creating and editing predominantly text document and once can edit text, copy, paste , delete and format text. Word processor relies heavily on editing of the contents rather than graphics or page layout where as DTP software is used to create image heavy newsletters, magazines, adverts, and brochures where layout is important.

4 0
3 years ago
In windows, a(n) ________ follows the file name and a period and indicates the file type.
larisa [96]
Ans : Extention

In windows, a(n) extension follows the file name and a period and indicates the file type.
4 0
4 years ago
Agent Phil Coulson developed this program to register Avengers in S.H.I.E.L.D's database using cutting-edge programming language
rosijanka [135]

eh I think yes I think. Maybe

6 0
3 years ago
A bubble starts by comparing the first item in the list to all the remaining items, and swaps where the first item is ____ a lat
Alina [70]

Answer:

greater than

i think

5 0
3 years ago
Read 2 more answers
Other questions:
  • What is the most effect way to include space after each paragraph
    14·1 answer
  • What do you call the combination of title, description, tags, and thumbnail?
    6·1 answer
  • Explain Cascading Style Sheets and what they do. Describe their primary function, two effects that this function has on programm
    11·1 answer
  • Can anyone please help with this programming code in python num= 7 if num > 3: print(“3”) if num < 5: print(“5”) if num ==
    6·1 answer
  • Select the statements that are true regarding the future of technology. Select 2 options.
    12·1 answer
  • What's the main piece of information you look for in an e-mail message you're investigating??
    14·2 answers
  • What is the component on the motherboard that confirms all devices are in working order once the computer is turned on?
    13·1 answer
  • If you give an actual answer I'll give brainliest​
    13·2 answers
  • What is the positional weigh of the digit 7 in the octal number 7642 ?​
    15·1 answer
  • Select the correct answer from each drop-down menu.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!