I am new to programming and I'm currently in a c++ class. The program I am trying to write will:
1) Ask the user to input number of employees
2) Ask the user to input number of days missed for each employee
3) Calculate the average days missed by dividing (days missed) / (number of employees)
For this assignment we are starting to learn about functions. So the professor wants us to use a separate function for each step. I have attempted this program, but when I run it an put in numbers to test I keep getting 1.79149e-307. Regardless of what numbers I use. Listed below is the program I created. If you see where the mistake was made please let me know.
I have tried testing many things but I think the problem starts where it tries to total up the number of days missed in Line 32. For some reason instead of giving me the total. It gives me the last number I inputted. For example if I says 5 employees, and then say employee 5 missed 4 days. The program displays that the total days missed is 4.