MyrtleTurtle 52 Junior Poster

The error I get is 'address of while(AreThereMore) will always evaluate to true.'

You need the ()'s when calling the function.

Also I see a couple of things in your AreThereMore() function:

If answer is not true, you need to set it to false. And when you compare you need to check each answer. Instead of

if (reply == 'Y'||'y') //this will always evaluate to true, I believe...because it is asking[I] if reply == 'Y' [/I]OR [I]if 'y'[/I]
{ 
answer=true; 
cin.ignore();
} 
else(reply== 'N'||'n');
{

You can say:

if (reply == 'Y'|| reply =='y')
{ 
answer=true; 
cin.ignore();
} 
else if(reply== 'N'|| reply =='n')
//or just put the else, without a comparison:
else{
//
}
MyrtleTurtle 52 Junior Poster

I suspect you will have several more errors show up.

You were right. I did what you advised, and everything you said was correct. Thank you for the help.

It did not work for me the first time I tried your advice because I only changed the ONE prototype. But when I changed them all, it did.

MyrtleTurtle 52 Junior Poster

do people jump down your throat

Not everyone. Mostly it's just one persistent mod.
lol

You should be able to write simple programs, and probably make errors while doing it.

I have that second part down pat.

Thank you both for the replies.

MyrtleTurtle 52 Junior Poster

As I said...

Well, shoot. You're right.

(again) :icon_redface:

WaltP commented: My comment was pointed at Vernon -- he said exactly what I said. You were agreeing. ;o) +11
MyrtleTurtle 52 Junior Poster

I think that they are similar, but IMHO it would be easier to learn one language first, get the basics down, and then concentrate on learning others. In my experience, quite a few of the more popular languages are similar, especially the basic concepts. It's mostly just the syntax that differs.

Ancient Dragon commented: Agree. +27
MyrtleTurtle 52 Junior Poster

here we do not not give programs to people,

Ah, so you do give programs to people?

//just kidding...double negative there, lol

WaltP commented: oops.... that was not not right, was it it? +11
MyrtleTurtle 52 Junior Poster

After compiling your code using my own input file I see the problem. You were adding the sum in the wrong place, which was after the last (unsuccessful) read from the file. It was adding a way huge number at the end, which made your calculations off.

I put a couple extra cout's in there to test. Remove them and this code should be what you want:

i = 0;
    fileIn >> scores[i];
    cout<<"scores[i]: "<<scores[i]<<endl;
    while (!fileIn.eof() && i < MAX_ARRAY)
    {
        sum+=scores[i];
        cout<<endl<<i<<": "<<sum<<endl;
        i++;
        fileIn >> scores[i];
        cout<<"scores[i]: "<<scores[i]<<endl;
			
    }
    numElms = i;

	cout << "\nAvg is: " << average(sum, numElms);
JHus00 commented: Thanks! +1
MyrtleTurtle 52 Junior Poster

Yes you can.

Oops. Sorry. Thanks for the correction. :$

Fbody commented: A point for willingness to learn. +1
MyrtleTurtle 52 Junior Poster

Hello.
I'm new here, too, but I have read the site rules. You're supposed to show an effort before the site's members will help you.

But the answer to your question is yes, there is code to solve that problem.

I'd get user input, put their numbers into an array and then check each number in the array. Or you could use a vector, I guess.

What code have you written so far?

Fbody commented: rule followers are good :) +1