Write a python program that does the following: 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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Write a python program that does the following:

  • 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 4 steps with 5 images

Blurred answer
Knowledge Booster
Constants and Variables
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education