what do u mean by it doesnt work? cause i get a syntax error when i try to compile...is that what the problem was?
nvm, i see where u put a comment.
okay. heres ur problem. you have it saying:
result + vaule = result
But C++ is very picky. you need it to be like this:
result = result + value
and it works good, besides the way it says "put in the 2 number" if i want it to average out 2 numbers...it just looks weird.
i am not sure why...but it just does.
and you dont have to change the wording...it just seemed weird to me.
okay. i just changed the cout line with this. i think it looks better.
cout << "You Want The Average of " << amount << " Numbers. Please Enter One of These Numbers: ";
cout << "Please enter number " << tellen << "/" << amount << ":"
yep that works too...glad i could help you with ur problem.
okay. good luck with chapter 2, 3, and so on.
Glad you got that worked out.
Just FYI:
The assignment operator ("=") isn't the same as the equals sign in mathematics. This is very important.
It only works one way. whatever value that is on the right once calculated will be added to the left. This works the same way for many things. Imagine if you used the input operator for the cout statement the way you used the assignment operator:
"Hi ">> "There" >> cout;
This would absolutely not work. so just get used to this aspect of programming. In almost all English versions of programming languages. the math (adding, sub, mult.) is done on the right and then assigned to the left. This is universal.
thx Why06. i didnt really know how to explain it...just knew it wouldnt work, lol.
result + value = result didn't work because in C++ using '=' indicates that you are passing the value of the expression on the right side, to the variable or whatever on the leftside