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
Why can’t I see one individual’s questions in the app through their profile, but I can see their questions on the website?
Mumz [18]

Answer:

I think thats just a software issue. i have the same problem

Explanation:

7 0
3 years ago
Read 2 more answers
Double bar graphs compare multiple what
GalinKa [24]
You would multiply by 2
7 0
3 years ago
A company ABC asked you to design a simple payroll program that calculates and employee's weekly gross pay, including any overti
julsineya [31]

Answer:

<em>C++.</em>

#include <iostream>

using namespace std;

////////////////////////////////////////////////////////////////

int main() {

   int weekly_hours = 0;

   int hourly_rate;

   float gross_pay = 0;

   cout<<"Enter weekly hours worked: ";

   cin>>weekly_hours;

   

   cout<<"Enter hourly rate: ";

   cin>>hourly_rate;

   

   cout<<endl;

   ////////////////////////////////////////////////

   if (weekly_hours > 40) {

       gross_pay = (weekly_hours*hourly_rate) + ((weekly_hours*hourly_rate)*0.5);

   }

   else

       gross_pay = weekly_hours*hourly_rate;

       

   cout<<"Weekly gross pay: $"<<gross_pay;

   ////////////////////////////////////////////////

   return 0;

}

3 0
3 years ago
You need to trace the route that a cat 6 utp cable takes through the ceiling and walls of your building. which tool should you u
Veronika [31]

We should use Tone Generator to to trace the route that a cat 6 utp cable takes through the ceiling and walls of your building. The tone generator can be used to test the speakers and their electrical wiring, as well as to find the frequency of hearing loss and tinnitus.

A sinusoidal signal is produced by a tone generator at the selected frequency. Can be used as a learning tool for physics as well as to test audio equipment like speakers or earbuds. You may also test the frequency range of tablet speakers.

Learn more about tone generator brainly.com/question/28017740

#SPJ4

4 0
1 year ago
How do I write my name in binary code?
Galina-37 [17]

Answer:

qUE

wHAT CODE

Explanation:

4 0
3 years ago
Other questions:
  • What's the fastest way to reset Android pin?​
    5·1 answer
  • Themes are applied from which tab?
    6·1 answer
  • By using the search functionality within a twitter stream, users can filter for:
    9·1 answer
  • Help me on this question
    14·1 answer
  • python This program outputs a downwards facing arrow composed of a rectangle and a right triangle. The arrow dimensions are defi
    5·2 answers
  • Write a program that prompts the user to enter a point (x, y) and checks whether the point is within the rectangle centered at (
    12·1 answer
  • Does anyone know why I get notifications on Brainly that say they are from 4 hours ago even though they were just answered
    9·1 answer
  • After assembling a computer system the very first software to be installed is​
    10·2 answers
  • An optical fibre has an attenuation of 0.3 dB/km. If a laser launches an optical power level of PIN (mW) into 35 km length of th
    8·1 answer
  • What will you see on the next line? &gt;&gt;&gt; int(6.5)
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!