Ben has been telling everyone he knows what a good job you’ve done for him. So his friend, Jeff, has decided that perhaps you can help him as well. At his company’s Christmas party, Jeff is planning on recognizing employees who have hit milestones in terms of their years of service with the company. He is hoping you can help him produce a report that will summarize the necessary information.
Jeff maintains a file of information on each of his employees, and is giving you access to it in order to create your report. Each employee is identified by an employee code. It is formed by taking the last four digits of the employee’s social security number and appending the last two digits of the year that employee was hired. Thus, an employee hired on 11/29/2009 having SSN 333-20-4567 would be given employee code 456709.
For this project, your program is to read information from the file data2.txt and create a summary report. The first line of the file contains a single integer, n, indicating the number of lines to follow. Each of those n lines contains the following information, in the given order and separated by a blank:
First name of the employee
Middle name of the employee
Last name of the employee
Numeric street address
Street name
Street type (Dr., Ave., Blvd., etc.)
Social security number
Date hired in mm/dd/yyyy format
Your program should produce a well-formatted report, including column headers, which should be written to the file employeeData.txt. It should contain the following information on each employee:
Employee code
Employee name (last name, first name middle initial. format)
Number of years with the company as of the end of 2012
For instance, if the contents of data2.txt were
3
James Allen Low 5678 Trenton Parkway 333-20-4567 11/29/2009
Peter Thomas Davis 245 Main St. 400-28-9687 9/14/2006
Alexis Catherine Peterson 34 Frontier Blvd. 212-56-7331 5/04/1999
the contents of employeeData.txt would look something like
EMPLOYEE CODE NAME YRS OF SERVICE
456709 Low, James A. 3
968706 Davis, Peter T. 6
733199 Peterson, Alexis C. 13
Ok, so you basically want us to do your homework for you? Try it yourself, and if you have difficulties/errors, then ask for help, but don't ask us to plain do it.
Originally Posted by Virtual Void
Ok, so you basically want us to do your homework for you? Try it yourself, and if you have difficulties/errors, then ask for help, but don't ask us to plain do it.
Opps. I failed to mention...
Im having trouble writing the name to the file in the correct order
What's so difficult about that? you have their first name, middle name and last name seperated, just do lastname, firstname & first letter of middle name.
tl;dr. Condense the information into one 3 sentance paragraph and I will help.
Originally Posted by Hell_Demon
What's so difficult about that? you have their first name, middle name and last name seperated, just do lastname, firstname & first letter of middle name.
Yeah, im doing for loops and get one variable complete, but idk how to reread the the file in the loop... @Hell_Demon @Jetamay
read line -> split on spaces -> done?
use UML(unified modelling language) notation to organize your code and make it readable. i cba to read all that crap.
or summarize it.