#include <fstream>usingnamespace std;
double averageDays(int, int);
//Function call for first function
employees = numberEmployees();
//Function call for second function
total = numberDays(employees);
//Function call for last function prototype
average = averageDays(employees, total);
//Performing output by main function
cout<< "The average number of days a company's employees are absent is: " <<average<<endl;
//Function header for number of employees
cout<<"Enter the number of employees in the company: ";
cout<<" Do not accept number less than 1. Please, enter again: ";
//Function header for the number of days
int numberDays(int w)
int workers = w;
int total = 0;
//Creating a loop for every employees' missed days
for (int count=0; count<workers; count++)
cout <<"Enter the number of days each employee missed during past year: "<<count+1<<endl;
cout<<"Please, do not enter negative number! Try again: ";
//Function header for average number of days absent
double averageDays (int work, int totl)
int w = work;
int t = totl;
I don't see the output file when I navigate to my C:\ drive. I have also tried refining my search to "output". still no luck. any suggestions ? Have I placed the code in the right area ?
When opening the file, I would just do 'output.open("output.txt");'. It should automatically save to the location of where your project is saved. And your not actually putting anything into the file, your just creating an empty one.
So I was just reading your code, before I run it, I want to ask you what are you trying to output to the file?, at the end I see that you are opening a file, but you are not trying to write to the file anywhere.
for example I didn't see anything like:
output << average;
and to make sure things save, you might want to close the file after you write to it to save changes etc.
let me know what you are trying to write, or if that works, then I will run it
Hey ! It works ! Thank You :)
I have included both output << average; and output.close;
I have the average as an output text file Now. Do you know how would I be able to have the entire console on the txt file ?