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
what optimizes airflow, keeps cylinder pressure in a certain range, and determines the engine's operating range?
emmainna [20.7K]
If you have choices, then I mut assume that these are following:
A. valve lift
B. push rod
C. intake manifold
D. valve timing. I think the answer is letter A.
6 0
4 years ago
Help!! Best answer will get Brainliest!!
Eddi Din [679]

Answer:

answer(s):

-set goals

-select a topic

-write down research questions

Hope this helped and sorry for the bold. <3

Explanation:

6 0
3 years ago
Read 2 more answers
Which address correctly represents one that is composed of two halves, one assigned to a network adapter manufacturer, and the o
Vlad1618 [11]
 Media access control address
5 0
3 years ago
Which of the following does not correctly declare an ArrayList?
kotegsom [21]

Answer:

Option b. ArrayList‹Integer› = new ArrayList‹Integer›(10) does not correctly declare an ArrayList.

<u>Explanation</u>:

ArrayList in Java dynamically stores elements in it. It also called as re- sizeable array as it expands  in size when elements are added and decreases when an element is removed from it. This array list class also allows to use duplicate and null values.

The syntax for creating Array list is as follows

ArrayList<Type> obj = new ArrayList<Type>()

Type  specifies the type of ArrayList like Integer, Character, Boolean etc, and obj is the object name. But in the option b ArrayList‹Integer› = new ArrayList‹Integer›(10)  object name is missed and not specified.

6 0
3 years ago
Print "userNum1 is negative." if userNum1 is less than O. End with newline Convert userNum2 to 0 if userNum2 is greater than 8.
Butoxors [25]

Answer:

import java.util.Scanner;

public class num1 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter User name 1 and 2");

       int userNum1 = in.nextInt();

       int userNum2= in.nextInt();

       if(userNum1<0){

           System.out.println("userNum1 is negative.");

       }

       else if(userNum2>8){

           userNum2 =0;

       }

       else{

           System.out.println("userNum2 is less than or equal to 8..");

       }

   }

}

Explanation:

This is implemented in Java programming language

Using the scanner class, the user is prompted to enter two numbers

These are saved in the variable userNum1 and userNum2 respectively.

If, else if and else statements are then used according to the specifications given in the question.

8 0
4 years ago
Other questions:
  • In Word, how can you tell when text is selected?
    8·1 answer
  • There are 10 red apples and 12 green apples in a basket. If Vinta randomly selects 3 apples from the basket, what is the probabi
    15·1 answer
  • 1.<br> The correct way to use a seat belt is
    8·1 answer
  • To prevent users of the application from changing the size of the form. you must set the FormBorderStyle property to ____
    6·1 answer
  • ___________ system allows us to talk to any person in the world it any time​
    15·2 answers
  • Which protocol sends a request to view or download a website or file ​
    7·1 answer
  • What do we call the input and output devices that are connected externally to the computer?
    10·2 answers
  • Identify at least five different Arts, A/V Technology, and Communications careers that you could pursue in your home state, and
    11·1 answer
  • Relationship between application system<br>.and database​
    11·1 answer
  • What is the size of the rc.conf file in bytes
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!