I am writing this program to use user defined functions, must be return value functions as well. It is a modification to a program already written, and am having a couple errors that I just cannot figure out. Here is the code, the errors I am getting when I compile the program are below the code. Any help is appreciated. Thank you.
//Program to calculate the average number of minutes
//excersized per week by an individual.
#include <iostream>
using namespace std;
int fsum(int sum, int number, int num_days, int counter);
double Average(int sum, int number, double Average);
int main()
{
int counter = 0 ;
int sum = 0 ;
const int limit = 7 ;
cout << "Enter number of minutes excercised per day." << endl;
cout << "Leave a space between each number of minutes." << endl;
cout << "Do not enter a value for zero minutes." << endl;
cout << "The first day of the week is Monday." << endl; \
int num_days = 0 ;
while( counter < limit )
{
int number ;
cin >> number ;
if (number > 0)
{
cout << "The total minutes excersized is " << fsum << endl;
}
if( num_days > 0 )
{
cout << "The average minutes excersized per day during this week is "
<< Average << endl;
cout << "The number of days excercised is " << num_days << endl;
}
return 0;
}
int fsum(int number, int sum, int num_days, int counter);
{
int number;
sum = sum + number;
num_days = num_days + 1;
counter = counter + 1 ;
return (sum);
}
double Average (int sum, int counter, double Average);
{ {
Average = sum / counter;
}
return Average;
}
Errors I am getting:
ExcerciseCalculator.cpp:54: non-lvalue in assignment
ExcerciseCalculator.cpp:56: warning: return to `int' from `double (*)(int, int, double)' lacks a cast
ExcerciseCalculator.cpp:59: parse error at end of input