Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create code that will open a text file for storing the employee information. The file must be opened so that entered data is added to

  1. Create code that will open a text file for storing the employee information.  The file must be opened so that entered data is added to the data already in the file.
  2. Modify the code that stores the data in list objects to now write the from date, to date, employee name, hours worked, pay rate, and income tax rate as a record in pipe-delimited format to the text file
  3. After the user terminates the data entry loop, call a new function that will:
    • Get input from the user for the From Date for which the report should be run. If the user enters "All" then all records will be read and displayed.  Validate that the from date entered is in the format mm/dd/yyyy.
    • Write a loop to read the records from the text file.  If the user entered "All" or the from date in the record matches what the user entered, store each data element in a variable, and for that employee calculate the income tax and net pay.
    • Display the from date, to date, employee name, hours worked, hourly rate, gross pay, income tax rate, income taxes and net pay for the employee inside the loop.
    • Increment the total number of employees, total hours, total tax, total net pay and store the values in a dictionary object inside the loop.
    • Display the totals after the loop terminates.
  • Ensure all functionality is working correctly and code is written efficiently. For purposes of this assignment, writing code efficiently is defined as:
    • Using correct naming conventions for all variables and objects.
    • Using correct naming conventions for functions and methods.
    • Using built-in functions whenever possible.
    • Using the fewest lines of code needed to return multiple values from functions.
    • Using the fewest lines of code needed to complete the functionality defined.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Heres a Python code snippet that accomplishes the tasks you described python Function to open the text file in append mode def openemployeefile try fi... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions