1. ## Function Program

Here is the problem:

Write a program that calculates the average number of days a company's employees are absent. The program should have the following function:

- a function called by main that asks the user for the number of employees in the company. this value should be returned as an int. ( the functions accepts no arguments)

- A function called by main int accepts one argument . the number of employees in the company. the function should ask user to enter the number of days each empolyee missed during the yr.the total of these days should be return as an int.
- a function called main that takes 2 arguments the number of employees in the company and the total number of days absent for all employees during the yr. the function should return as a double, the avrage number of days absent. (input invalidation : don't accept a number less than 1 for the number of employees. dont accept a negative number for the days any employees missed)

thanks I really need help

2. What have you tried?

3. we are using c++ ... here is wat i came up wit
Code:
```#include <iostream>
using namespace std;

void displayvalue (int)
int _tmain()
{
int num1,
num2; //  holds the value of number

cout << "Enter number of employees in the company:\n";
cin >> num1;
cout <<"Enter number of employees missed:\n";
cin >> num2;
return 0;
}```

4. can u help me start this program

5. Well first thing you will need before your main function is there function prototypes and after your main function you need to define those depending on what they need to do.

6. Well, consider this:
- a function called by main that asks the user for the number of employees in the company. this value should be returned as an int. ( the functions accepts no arguments)
Try to write this function. You pretty much have the right idea for this part, except that you are not putting it into another function.

You should use a loop for this:
- A function called by main int accepts one argument . the number of employees in the company. the function should ask user to enter the number of days each empolyee missed during the yr.the total of these days should be return as an int.
Are you sure that you copied this correctly?
- a function called main that takes 2 arguments the number of employees in the company and the total number of days absent for all employees during the yr. the function should return as a double, the avrage number of days absent.
Those requirements are incorrect since it is forbidden to overload the global main function. However, we can infer that the "2 arguments" do not describe the arguments to the function, but to the reading of input from the user and computation of the total number of days absent. Furthermore, the "return as a double" should actually be "print as a double".

Also, try to make your indentation consistent. Use descriptive variable names.

7. Originally Posted by cutie0507
- a function called main that takes 2 arguments the number of employees in the company and the total number of days absent for all employees during the yr. the function should return as a double, the avrage number of days absent. (input invalidation : don't accept a number less than 1 for the number of employees. dont accept a negative number for the days any employees missed)
I am going to assume that you meant a function called by main here too?