This is a Python program   Reads information from a text file into a list of sublists. Be sure to ask the user to enter the file name and end the program if the file doesn’t exist. Text file format will be as shown, where each item is separated by a comma and a space: ID, firstName, lastName, birthDate, hireDate, salary Store the information into a list of sublists called empRoster. EmpRoster will be a list of sublists, where each sublist contains the information for one employee. The birthDate and hireDate in file are strings, but should be stored as objects of type Date. Example of EmpRoster list with 2 employees: [   [111,”Joe”, “Jones”, “09-01-1980”,”10-19-1999”, 95000],     \       [222, “Sam”, “Smith”, “07-10-1956”,, “01-01-2000”,  50000]    ] Print a report that shows the following:             Employee Roster ID    First Name          Last Name           Birth Date           Age        Hire Date  YrsWorked        Salary WRITE the following information out to a text file – ask the user what the text file should be named! Employees over 60 years old Employees with salaries above 50000 Employees that have worked for the company more than 20 years Example input file: 111, Joe, Jones, 09-01-1980, 10-19-1999, 95000 222, Sam, Smith, 07-10-1956, 01-01-2000, 50000 333, Rick, Robins, 08-01-1960, 08-20-1998, 100000 Example report for the sample data:                                                             Employee Roster ID           First Name          Last Name           Birth Date           Age        Hire Date             Yrs Worked               Salary 111        Joe                        Jones                    Sep 1, 1980         39           Oct 19, 1999       21                         95000 222        Sam                      Smith                    Jul 10, 1956        63           Jan 1, 2000         20                          50000 333        Rick                       Robins                  Aug 1, 1960        59           Aug 20, 1998      22                         100000    Example output file: Employees over 60 years old: Sam Smith Employees with salaries above 50000: Joe Jones Rick Robins Employees that have worked for the company more than 20 years Joe Jones Rick Robins

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question

                                               This is a Python program

 

  • Reads information from a text file into a list of sublists.
    • Be sure to ask the user to enter the file name and end the program if the file doesn’t exist.
    • Text file format will be as shown, where each item is separated by a comma and a space:
      ID, firstName, lastName, birthDate, hireDate, salary
  • Store the information into a list of sublists called empRoster.
    EmpRoster will be a list of sublists, where each sublist contains the information for one employee.
    The birthDate and hireDate in file are strings, but should be stored as objects of type Date.
    Example of EmpRoster list with 2 employees:
    [   [111,”Joe”, “Jones”, “09-01-1980”,”10-19-1999”, 95000],     \
          [222, “Sam”, “Smith”, “07-10-1956”,, “01-01-2000”,  50000]    ]

  • Print a report that shows the following:
                Employee Roster
    ID    First Name          Last Name           Birth Date           Age        Hire Date  YrsWorked        Salary

  • WRITE the following information out to a text file – ask the user what the text file should be named!
    • Employees over 60 years old
    • Employees with salaries above 50000
    • Employees that have worked for the company more than 20 years

  • Example input file:
    111, Joe, Jones, 09-01-1980, 10-19-1999, 95000
    222, Sam, Smith, 07-10-1956, 01-01-2000, 50000
    333, Rick, Robins, 08-01-1960, 08-20-1998, 100000

  • Example report for the sample data:

                                                            Employee Roster

ID           First Name          Last Name           Birth Date           Age        Hire Date             Yrs Worked               Salary

111        Joe                        Jones                    Sep 1, 1980         39           Oct 19, 1999       21                         95000

222        Sam                      Smith                    Jul 10, 1956        63           Jan 1, 2000         20                          50000

333        Rick                       Robins                  Aug 1, 1960        59           Aug 20, 1998      22                         100000 

 

  • Example output file:

Employees over 60 years old:
Sam Smith

Employees with salaries above 50000:
Joe Jones

Rick Robins

Employees that have worked for the company more than 20 years

Joe Jones
Rick Robins

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning