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]
2 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]2 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
Which of the items below are nodes? fax, IC, NOC, printer, twisted pair cables and workstation.
RSB [31]

The answer is Printer, workstation, NOC, and fax.

Any devices or systems connected to a network are called nodes. When defining a node, always have in mind that it is anything that has an IP address. For instance, if a network connects 5 computers, 1 file server, and 2 printers, there are 8 nodes on this network.

3 0
3 years ago
he transport layer on the destination host O reassembles the application message if it has been fragmented O removes the transpo
Dafna1 [17]

Answer: Both A and B

Explanation: Transport layer is the level of the OSI model which is helpful in maintaining the overall network communication.The application process that is being executed in the layers of architecture gets logical communication through transport layer.

It has the ability to connect the data that has been divided into section for the transportation.It can also act on the transport header ,which finds the transmission flow of specific data when not required.

4 0
3 years ago
1. Jaina is a big fan of a popular comic book series, and is so inspired that she decides to write her own story. She starts her
dolphi86 [110]

Answer:

copyright infringement

Explanation:

4 0
3 years ago
A linear representation of a hierarchical file directory is known as what?
MissTica
It is known as a directory path
5 0
3 years ago
100 points !!! Some games fall under more than one category. For example, many racing games allow players to modify the cars the
Ugo [173]

Answer:

game 1: roblox, its not technically a game, however it contains game that could fall under more than one category. Game 2: Dungeons and Dragons could fall under role play and also adventure

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Given the following adjacency matrix, what is the approximate rank vector after one iteration of the power iteration method (use
    10·1 answer
  • Create a structure named planet This structure will contain distance from Earth as an integer Atmosphere, language, people and p
    8·1 answer
  • A _____ is a network that uses multiple access points to link a series of devices that speak to each other to form a network con
    10·1 answer
  • What does it mean when system ui has stopped?
    9·1 answer
  • ______ is the software that prevents people from being able to access your personal information.
    8·2 answers
  • pDevices used to prevent data from being written to a disk can connect to a computer through FireWire, SATA, PATA, and SCSI cont
    10·1 answer
  • What makes the huns a formidable force for the roman empire?
    5·1 answer
  • Match the component to its function. resistor inductor capacitor battery transistor This component stores a temporary charge. ar
    7·2 answers
  • Public class Main{ public static void main(String [] args){ String name=WelcomeJava; Runnable r1=() -> System.out.println(nam
    12·1 answer
  • please help no one is helping me on this one
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!