While there are no hard and fast rules for function design there are a few things to keep in mind. Keep it simple and short. You'll defeat the purpose of using a function if it is 50 to 100 lines long. Most functions should be 20 lines or less. If an operation is performed multiple times in the same program it will be more efficient to code this as a function that can be called from wherever it is needed.
Functional cohesion is a measure of how closely the processes in a function are related.
Each function should do only one thing. All the statements in a function should contribute only to that one thing. As an example, if a function is to compute an employee's gross pay from the number of hours worked and hourly rate then all it should do is compute and return the gross pay. For this assignment you will need to download two files - the program file Lab8.cpp and a text file named employee.txt . Be sure to save the program you are working on periodically and remember to change up with your lab teammate at the beginning of each task or where instructed to do so.