I have tried the two ways below to get my functions to call and run, but VS gives me the error

error c2660: ..... function does not take 0 arguments

First way tried

//Michelle CSI 130 Lab 11 Part 2 Section B
//Digital logic and Boolean algebra
#include <iostream>
using namespace std;

int count (int I, int N)
{//PURPOSE: Allows the user to enter as many numbers as they like and keeps a running count, till they end with -1.
//INPUT: Number will be entered one at a time and stored in n.
//OUTPUT: Number count.    
    I=0, N=0;
    cout << "Enter positive numbers one at a time.\n" << "When complete enter -1.\n";
    cin >> N;
    N=N;
    I=I+1;
    
    while (N>=0)
    {    cin >> N;
        N=N;
        I=I+1;
    }
    return I;
}

int avg (int i, int n, int avg, int sum)
{//PURPOSE: Allows the user to enter as many numbers as they like, it keeps a running count and average, till they end with -1.
//INPUT: Number will be entered one at a time and stored in n.
//OUTPUT: Number average.    
    i=0, n=0, avg=0, sum=0;
    cout << "Enter positive numbers one at a time.\n" << "When complete enter -1.\n";
    cin >> n;
    sum=n;
    i=i+1;
    
    while (n>=0)
    {    cin >> n;
    sum=sum+n;
    i=i+1;
    avg=sum/i;
    }
    return avg;
}

int Highest (int n, int large)
{//PURPOSE: Allows the user to enter as many numbers as they like and keeps a record of highest number, till they end with -1.
//INPUT: Number will be entered one at a time and stored in n.
//OUTPUT: Highest number.    
    n=0, large=0;
    cout << "Enter positive numbers one at a time.\n" << "When complete enter -1.\n";
    cin >> n;
    large=n;

    while (n>=0)
    {    cin >> n;
        while (n>large)
        {    large=n;
        }
    }
    return large;
}

int Lowest (int n, int low)
{//PURPOSE: Allows the user to enter as many numbers as they like and keeps a record of lowest number, till they end with -1.
//INPUT: Number will be entered one at a time and stored in n.
//OUTPUT: Lowest number.    
    n=0, low=0;
    cout << "Enter positive numbers one at a time.\n" << "When complete enter -1.\n";
    cin >> n;
    low=n;

    while (n>=0)
    {    cin >> n;
        while (n<low)
        {    low=n;
        }
    }
    return low;
}



int main()
{//PURPOSE: Allows the user to enter their choice of which calculation they would like to make of the numbers they enter.
//INPUT: Users choice and stored in Choice.
//OUTPUT: None.    
    int Choice;
    cout << "Please choose an option\n" << "1. Count the number of entries.\n" << "2. Calculate the average.\n" << "3. Determine the highest number.\n" << "4. Determine the lowest number.\n";
    cin >> Choice;
    if (Choice==1)
    {    cout << count();
    }
    else if(Choice==2)
    {    cout << avg();
    }
    else if (Choice==3)
    {    cout << Highest();
    }
    else 
    {    cout << Lowest();
    }

    return 0;
}

second way tried

#include <iostream>
using namespace std;

void count (int I, int N)
{//PURPOSE: Allows the user to enter as many numbers as they like and keeps a running count, till they end with -1.
//INPUT: Number will be entered one at a time and stored in n.
//OUTPUT: Number count.    
    I=0, N=0;
    cout << "Enter positive numbers one at a time.\n" << "When complete enter -1.\n";
    cin >> N;
    N=N;
    I=I+1;
    
    while (N>=0)
    {    cin >> N;
        N=N;
        I=I+1;
    }
    cout << "Number count is: " << I;
}

void avg (int i, int n, int avg, int sum)
{//PURPOSE: Allows the user to enter as many numbers as they like, it keeps a running count and average, till they end with -1.
//INPUT: Number will be entered one at a time and stored in n.
//OUTPUT: Number average.    
    i=0, n=0, avg=0, sum=0;
    cout << "Enter positive numbers one at a time.\n" << "When complete enter -1.\n";
    cin >> n;
    sum=n;
    i=i+1;
    
    while (n>=0)
    {    cin >> n;
    sum=sum+n;
    i=i+1;
    avg=sum/i;
    }
    cout << "Number average is: " << avg;
}

void Highest (int n, int large)
{//PURPOSE: Allows the user to enter as many numbers as they like and keeps a record of highest number, till they end with -1.
//INPUT: Number will be entered one at a time and stored in n.
//OUTPUT: Highest number.    
    n=0, large=0;
    cout << "Enter positive numbers one at a time.\n" << "When complete enter -1.\n";
    cin >> n;
    large=n;

    while (n>=0)
    {    cin >> n;
        while (n>large)
        {    large=n;
        }
    }
    cout << "Largest number is: " << large;
}

void Lowest (int n, int low)
{//PURPOSE: Allows the user to enter as many numbers as they like and keeps a record of lowest number, till they end with -1.
//INPUT: Number will be entered one at a time and stored in n.
//OUTPUT: Lowest number.    
    n=0, low=0;
    cout << "Enter positive numbers one at a time.\n" << "When complete enter -1.\n";
    cin >> n;
    low=n;

    while (n>=0)
    {    cin >> n;
        while (n<low)
        {    low=n;
        }
    }
    cout << "Smallest number is: " << low;
}



int main()
{//PURPOSE: Allows the user to enter their choice of which calculation they would like to make of the numbers they enter.
//INPUT: Users choice and stored in Choice.
//OUTPUT: None.    
    int Choice;
    cout << "Please choose an option\n" << "1. Count the number of entries.\n" << "2. Calculate the average.\n" << "3. Determine the highest number.\n" << "4. Determine the lowest number.\n";
    cin >> Choice;
    if (Choice==1)
    {    count();
    }
    else if(Choice==2)
    {    avg();
    }
    else if (Choice==3)
    {    Highest();
    }
    else 
    {    Lowest();
    }

    return 0;
}

Any help is appreciated.

In your main loop, like when you call count(); you need to include parameters to match your function definition int count (int I, int N) So either you need to remove the parameters in the definition (make int count () or include them when you call the function (

int x = 0, y = 0;
if (Choice==1)    {
    count(x,y);    
}

You have quite a few problems here:

1) One of your function names is, "avg". One of your variable names within the function name, "avg" is also "avg". VS is unable to discern the difference between the two, and does not accept your variable within the function as an argument.

To fix this: Simply rename either the function or variable.

2) Next problem is that you did not give the functions arguments. See where you are trying to call upon the secondary functions in the main function? Just add the variables within the parenthesis of that, without the declaration of 'int' or char'.

3) You did not declare your variables within the function, you just have n=0, l=0, etc. Make sure you add 'int' before them!

4) You want to return all of the variables, correct? In order for you to do this, you need to add the ampersand character, "&" in between the 'int' and variable in your functions.

5) You are reinitializing the variables in your functions. Do not do this. Instead declare all functions in main, and switch them into the function.

6) You have a few un-needed equations such as 'N=N' ... well of course it does.

Alright my friend, since there were so many corrections, I am sure you will have questions. So instead, I have completed your code so you can take a look at some of the corrections yourself, and see what I am talking about. (I am not that great at explaining things.) Anyhow, here is your code all debugged:

#include <iostream>
using namespace std;
 
void count (int & I, int & N)
{//PURPOSE: Allows the user to enter as many numbers as they like and keeps a running count, till they end with -1.
//INPUT: Number will be entered one at a time and stored in n.
//OUTPUT: Number count.    
    cout << "Enter positive numbers one at a time.\n" << "When complete enter -1.\n";
    cin >> N;
    I=I+1;
 
    while (N>=0)
    {    cin >> N;
        I=I+1;
    }
    cout << "Number count is: " << I;
}
 
void avg (int & i, int & n, int & average, int & sum)
{//PURPOSE: Allows the user to enter as many numbers as they like, it keeps a running count and average, till they end with -1.
//INPUT: Number will be entered one at a time and stored in n.
//OUTPUT: Number average.    
    cout << "Enter positive numbers one at a time.\n" << "When complete enter -1.\n";
    cin >> n;
    sum=n;
    i=i+1;
 
    while (n>=0)
    {    cin >> n;
    sum=sum+n;
    i=i+1;
    average=sum/i;
    }
    cout << "Number average is: " << average;
}
 
void Highest (int & n, int & large)
{//PURPOSE: Allows the user to enter as many numbers as they like and keeps a record of highest number, till they end with -1.
//INPUT: Number will be entered one at a time and stored in n.
//OUTPUT: Highest number.    
    cout << "Enter positive numbers one at a time.\n" << "When complete enter -1.\n";
    cin >> n;
    large=n;
 
    while (n>=0)
    {    cin >> n;
        while (n>large)
        {    large=n;
        }
    }
    cout << "Largest number is: " << large;
}
 
void Lowest (int & n, int & low)
{//PURPOSE: Allows the user to enter as many numbers as they like and keeps a record of lowest number, till they end with -1.
//INPUT: Number will be entered one at a time and stored in n.
//OUTPUT: Lowest number.    
    cout << "Enter positive numbers one at a time.\n" << "When complete enter -1.\n";
    cin >> n;
    low = n;
 
    while (n>=0)
    {    cin >> n;
        while (n<low)
        {  
			low = n;
        }
    }
    cout << "Smallest number is: " << low;
}
 
 
 
int main()
{//PURPOSE: Allows the user to enter their choice of which calculation they would like to make of the numbers they enter.
//INPUT: Users choice and stored in Choice.
//OUTPUT: None.  
    int low=0, large=0, Choice, I=0, N=0, avg1 = 0, i=0, n=0, average=0, sum=0;

    cout << "Please choose an option\n" << "1. Count the number of entries.\n" << "2. Calculate the average.\n" << "3. Determine the highest number.\n" << "4. Determine the lowest number.\n";
    cin >> Choice;
    if (Choice==1)
    {    
		count(I, N);
    }
    else if(Choice==2)
    {    
		avg(i, n, average, sum);
    }
    else if (Choice==3)
    {    
		Highest(n, large);
    }
    else 
    {  
		Lowest(n, low);
    }
 
    return 0;
}

Hope this helped.

Thanks everyone for the assistance.

Here is what I ended up turning in, while it might not be the best solution, it did get my program working error free.

//Digital logic and Boolean algebra
#include <iostream>
using namespace std;

void count()
{//PURPOSE: Allows the user to enter as many numbers as they like and keeps a running count, till they end with -1.
//INPUT: Number will be entered one at a time and stored in n.
//OUTPUT: Number count.	
	int I=0, N=0;
	cout << "Enter positive numbers one at a time.\n" << "When complete enter -1.\n";
	cin >> N;
	N=N;
	I=I+1;
	
	while (N>=0)
	{	cin >> N;
		N=N;
		I=I+1;
	}
	I=I-1;
	cout << "Number count is: " << I << endl;
}

void avg()
{//PURPOSE: Allows the user to enter any 6 numbers they like, and averages those.
//INPUT: Number will be entered one at a time and stored in n.
//OUTPUT: Number average.	
	float n1=0, n2=0, n3=0, n4=0, n5=0, n6=0, avg=0, sum=0;
	cout << "Enter positive numbers one at a time.\n";
	cin >> n1;
	cin >> n2;
	cin >> n3;
	cin >> n4;
	cin >> n5;
	cin >> n6;
	sum=n1+n2+n3+n4+n5+n6;
	avg=sum/6;
	cout << "Number average is: " << avg << endl;
}

void Highest()
{//PURPOSE: Allows the user to enter as many numbers as they like and keeps a record of highest number, till they end with -1.
//INPUT: Number will be entered one at a time and stored in n.
//OUTPUT: Highest number.	
	int n=0, large=0;
	cout << "Enter positive numbers one at a time.\n" << "When complete enter -1.\n";
	cin >> n;
		large=n;

	while (n>=0)
	{	cin >> n;
		while (n>large)
		{	large=n;
		}
	}
	cout << "Largest number is: " << large << endl;
}

void Lowest()
{//PURPOSE: Allows the user to enter as many numbers as they like and keeps a record of lowest number, till they end with -1.
//INPUT: Number will be entered one at a time and stored in n.
//OUTPUT: Lowest number.	
	int n=0, low=0;
	cout << "Enter positive numbers one at a time.\n" << "When complete enter 100.\n";
	cin >> n;
	low=n;

	while (n!=100)
	{	cin >> n;
		while (n<low)
		{	low=n;
		}
	}
	cout << "Smallest number is: " << low << endl;
}



int main()
{//PURPOSE: Allows the user to enter their choice of which calculation they would like to make of the numbers they enter.
//INPUT: Users choice and stored in Choice.
//OUTPUT: None.	
	int Choice;
	cout << "Please choose an option\n" << "1. Count the number of entries.\n" << "2. Calculate the average.\n" << "3. Determine the highest number.\n" << "4. Determine the lowest number.\n";
	cin >> Choice;
	if (Choice==1)
	{	count();
	}
	else if(Choice==2)
	{	avg();
	}
	else if (Choice==3)
	{	Highest();
	}
	else 
	{	Lowest();
	}

	return 0;
}

"Best" is a relative term, and is very hard to accomplish. Especially when you are learning programming in the first place. "Working error free" is slightly more specific, but a very good goal indeed! The most important part of programming is learning: when you are done with your program, study it to see how you can make it more efficient in the future. Hindsight makes it easy to see spots where you can make changes, and as you learn new techniques your programs end up better each time. Plus, reviewing old code helps test the thoroughness of your comments and see the advantages of programming for maintainability (structure, object orientedness, meaningful variables and function names, etc.)

Welcome to programming and good luck!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.