You will be taking in a file (payroll.txt) which details a number of departments (at least 1) and in each department are a set of employees (each department will have at least 1 employee or it would not appear on the payroll sheet). Your job is to read the file in separate out each employee and calculate the total values (hours, salary, number of employees) for each department and in each category (F1, F2, F3, F4). In your final submission please include the .cpp file which should work for any kind of payroll file I supply (which will naturally match the format of the examples below). Be sure to indicate in your submission file if you have attempted any of the bonus points .
An example file (note that your program needs to be able to handle any file formatted in a similar way):
The IT Department
Bill 8 hours 20 minutes 7hours 8hours 30 minutes 9hrs 10min 57 minutes F1
Betty 8hrs 8hrs 30min 7hrs 5min 8hrs 7hrs 10min F2
Brandon 10hours 10hours 5 minutes 9 hours 5 hours 55 minutes 9 hours 5 minutes F2
Brad 9hrs 8hrs 10hrs 12min 9hrs 4min 8hours 6min 3hrs 24min 1hr 6min F4
The Sales Department
Kyle $24,000 0.105 F3
Tyler $18,203 0.085 F3
Konner 8hrs 6hrs 5min 7hrs 6 hrs 9 hrs 8 min F2
Sam $30,011 0.045 F3
Kent 9hrs 8hrs 1min 9 hrs 7hrs 5 min 8 hrs 55min 6min 1hr F4
The Overseas Department
Jim $24,000 0.105 F3
Frank 7 hours 10 minutes 6hours 1 minute 1 hour 50 minutes 8hours 10min 1hour 34 minutes F1
Lester 8hrs 5min 8hrs 30min 7hrs 5min 8hrs 7hrs 10min F2
EOF
First there is the name of the employee, followed by a list of times (for f1, f2 and f4). The times are reported by a number of different systems and the hours and minutes may be represented differently. Hours and hrs, or Minutes an mins. The final times should be rounded to the nearest half hour, where for example 2 hours and 15 minutes would be 2.5 hours. The times may specify the hours and minutes or just one or the other. And yes they could only work for a few minutes (maybe they only run into work to sign a paper or something). The last in the row after the hours comes the pay grade (F1, F2, F3, F4). The number of hours recorded is based on the pay grade of the employee. F1 and F2s will have 5 numbers for their hours. F3s a bit different since they are commission based where a sales amount and a commission percentage is given. F3s are also assumed to work 30 hours if their commission is 10% or below and 40 hours if their commission is above 10%. F4s will have 7 numbers (as they are on-call during the weekend). Each of the pay grades will also have different pay calculations which are as follows:
F1 = The total number of hours * 12.15
F2 = (The total number of hours – 35) * 18.95 + 500
F3 = The total sales amount * the commission rate
F4 = The first 5 hourly totals * 26.55 + Any weekend hourly totals (the last 2) * 39.75
Your output to the screen should start with the department name, followed by the total pay for all of the employees, then the total number of hours, and the total number of employees. After that you should have a breakdown of each category of employee: F1 total pay and total hours, F2 total pay and total hours…
Each department will have at least 1 employee and each department will contain the word “Department.”
The IT Department
Total Salary: $##.##
Total Hours: ###
Total Number of Employees: ##
Roster: Bill, Bob, Betty, Brandon, Brad
F1:
Total Salary: $##.##
Total Hours: ###
Total Number of Employees: ##
F2:
Total Salary: $##.##
Total Hours: ###
Total Number of Employees: ##
F3:
Total Salary: $##.##
Total Hours: ###
Total Number of Employees: ##
F4:
Total Salary: $##.##
Total Hours: ###
Total Number of Employees: ##
The Sales Department
Total Salary: $##.##
Total Hours: ###
Total Number of Employees: ##
Roster: Kyle, Tyler, Konner, Sam, Kent
F1:
Total Salary: $##.##
Total Hours: ###
Total Number of Employees: ##
F2:
Total Salary: $##.##
Total Hours: ###
Total Number of Employees: ##
F3:
Total Salary: $##.##
Total Hours: ###
Total Number of Employees: ##
F4:
Total Salary: $##.##
Total Hours: ###
Total Number of Employees: ##
Before coding your solution, take the time to design the program. What are the possible things that the file can have that you need to anticipate? What are the actions that you need to take (read the file, add up hours…)? Are those actions things that could be placed in separate functions? What about the function – can you guess some of the things that will happen? Such as, using substring to pull out part of a line in the file maybe using stoi to convert a string to an integer to add it to the total or creating variables to hold the employee type you find before passing it to another function. Finally, how are these functions called, what is the order and what information is passed to and from?
Scoring Breakdown
25% program compiles and runs
30% program reads in and calculates the figures for output
10% the program is appropriately commented
35% outputs the correct information in a clear format
5% bonus to those who can output the F# responses in a columned output like that shown above.
5% bonus to those who do a chart comparing the data at the end to show the relation between the pay grades and the amount of salary spent in each (they style of chart is up to you and more points may be given for more difficult charts (like a line chart):
B Department
F1 – 00000000
F2 – 000000
F3 – 00000
F4 – 000000000000
K Department
F1 – 0
F2 – 0000
F3 – 0000000000
F4 – 0000000
Or event something like this instead:
0
0 0
0 0 0
0 0 0 0
0 0 0 0
F1 F2 F3 F4
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
Ace Writing Center has stood as the world’s leading custom essay writing services providers. Once you enter all the details in the order form under the place order button, the rest is up to us.
Essays
At Ace Writing Center, Nowadays, students normally have extremely busy schedules. You will note that some of them have to take on some evening or weekend jobs in order to get some income that can help them to sustain in college or in the university. This can deny them a chance to write all the essays given. Others usually get bombarded with a lot of work by their lecturers. This can still delay such students from working on all their essays. However, some of them usually try to work on all these essays but end up delivering their work late. This can prevent them from graduating since most lecturers are strict on deadlines. If you want to write a business essay, the wise way is to hire an outstanding essay writing service like us, so that you can get the best results. If you are keen, you will note that many companies usually overcharge their customers. Some of them are there only to make money. And in reality, they really don’t care to build a long term commitment with students. You should not choose such companies. You should take your time and choose a reliable company to work with. Ace Writing Center is the ultimate solution for you. We have been offering our writing service for more than 7 years. This is a clear indication that you will get quality essay writing service. We have a wide range of writers who can work on any business essay that you might have. We believe in doing extensive research so that we can provide quality work to all our clients. .
Admissions
Admission and Business Papers
Have you ever had to write an admission essay for college? The majority of students face the same issues when applying to a university or college and many in such situations decide they need professional help to cope with this matter. They get in a situation when the deadline keeps coming closer but lack motivation to start because they are just not sure if their writing skills are strong enough. We have a solution for you! Ace Writing Center is the best admission essay writing service with a large professional team and years of experience in providing high-quality papers to students of all levels and faculties. The mission of our team is to help students make their dreams of entering a good college come true and that’s what we offer!.
Editing
Editing and Proofreading
Sometimes all the words for your paper just flow out of your mind and into your fingers. You type quickly at your keyboard and there they are, your beautiful words right there on the screen. But you have no idea how to polish it up. You may be wishing there was a paper writing service that offered this type of writing service. Look no more! Here at Ace Writing Center, we offer you an editing and proofreading option that you can't find anywhere else..
Coursework
College Essay Writing
In case you are familiar Ace Writing Center, you know the way to distinguish a better company from a cheap one exactly. First of all, poor service website does not have a sufficient support. We think support team is an essential part of success; it has to answer all clients’ questions and be a connecting link between clients and their writers. On our web-service you will get answers about anything you need and your writer will receive all your instructions, assignments and requirements exactly and swiftly. A writing service that we run has got a flexible pricing system that will save you from senseless wastes and many bonus systems that let you sparing money for something important for you.