1. ## Averaging code

Code:
#include <iostream>
#include <string>
using std::cout;
using std::endl;
using std::cin;
using std::string;

int main()
{

const int AVERAGE = ;
int number;

cout << "Pick a number!: ";
cin >> number;
cout << "Another number: ";
cin >> number;
cout << "Last number!!: ";
cin >> number;

cout << "\nThe avereage is: " << (AVERAGE) << "\n";

system("\nPAUSE");
return 0;

}
I dont know how to get the three numbers totaled, and how to divide them with the constant. help.

2. One approach is to initialise the sum and count to 0. Whenever you read a number from the user, add it to the sum, then increment the count. When you are done, divide the sum by the count, and you have the average (arithmetic mean).

Code:
#include <iostream>
#include <string>
using std::cout;
using std::endl;
using std::cin;
using std::string;

int main()
{

const int AVERAGE = ;
int number;

cout << "Pick a number!: ";
cin >> number;
cout << "Another number: ";
cin >> number;
cout << "Last number!!: ";
cin >> number;

cout << "\nThe avereage is: " << (AVERAGE) << "\n";

system("\nPAUSE");
return 0;

}
I dont know how to get the three numbers totaled, and how to divide them with the constant. help.
First of all, you need to assign the const int a value, in this case you could make it 3, and divide the total of the inputted numbers to get the average value. But you don't really need it i guess.

Second of all, you only have 1 variable for storing numbers,and you use it 3 times, each time the value in the variable gets overwritten. What you want is 3 doubles, which you then ask the user to input a number into,for each of them. Then to calculate the average you add up all the numbers (Possibly in a fourth variable, or you could use one of the existing ones to hold the total value), and divide by the number of inputted values, in this case 3...

4. Code:

const int AVERAGE = 3;

cout << "Pick a number!: ";
cin >> number;
cout << "Another number: ";
cin >> number1;
cout << "Last number!!: ";
cin >> number2;

cout << "\nThe avereage is: " << (AVERAGE) << "\n";
I still don't know how to get the total of all three numbers. I added add to my ints, but do not know how to use it. Now the average is 3 everytime. lol

I still don't know how to get the total of all three numbers.
Are you serious, or is this some kind of troll? There is a key on your keyboard, looks like this: + You may want to look into it. You've already figured out =. Seriously: read a thread on here that you didn't start. You could even search the board for the word "average", since we had somebody else last week ask pretty much the same question. Or find a thread where someone does a calculation, we've got lots of those, and look at what a calculation looks like in C.

6. I dont like our attitude

7. Sorry if the question is to "simple" but I cant figure it out. So im asking. Help, how do I add the three numbers, and divide them.

I dont like our attitude

9. I still don't know how to get the total of all three numbers.
If you want to use the approach described by Neo1 then you should use an array instead.

With what I described, and using a fixed total count, I would expect something along these lines:
Code:
const int count = 3;
double sum = 0.0;
int count = 0;

double number;
cout << "etc";
cin >> number;
sum += number;

// ...

cout << (sum / count);

I dont like our attitude
I don't particularly like our attitude either. But still: look around! I admit that only six of the twenty threads on the front page had calculations in them; but when you see things like
Code:
p=a*a*a*a-6*a*a*b*b+b*b*b*b;
(taken from another thread), it shouldn't be much of a stretch to figure out how to add three numbers. Tell you what: if you give me a good reason why you couldn't find how to add numbers in a C++ programming book, or why you didn't read LESSON 1: INTRO TO C++ on this very site, then I'll apologize.

11. Code:
const int AVERAGE = 3;

cout << "Pick a number!: ";
cin >> number;
cout << "Another number: ";
cin >> number1;
number + number1 =;
cout << "Last number!!: ";
cin >> number2;
number + number1 + number2 =;
cout << "\nThe avereage is: " << (AVERAGE) << "\n";
I am reading the lesson one. I am not sure where the "double" comes in. sorry if i am dumb.
I am getting compile error with the code now.

12. I am not sure where the "double" comes in.
You might find it necessary if you want a more precise average, but perhaps it is best left for you to discover after you have fixed your current problem.

I am getting compile error with the code now.
When you wrote this piece of code:
Code:
number + number1 =;
and then this line:
Code:
number + number1 + number2 =;
What did you think they would do?

13. Let's just give some hints:
What operator do you use normally when you want to add? we all know that's the + operator.
How do you assign a variable a value in C++? try to find that out (you should know already). A special operator is used.
Now, if you know how to do what's above then this should be easy. To calculate the average, just get the total of all the numbers (which in this case would be the sum of the three numbers), then divide that by how many numbers you have (in this case: 3).

Still need some help?

14. Here's what I think.
dead_captain needs to get a book or find some online tutorials and actually learn the language before trolling us with poor questions that's easily learned from a good book that covers the language.
You won't get anywhere if you don't know the language. You'll keep coming back asking us what's this and what's that, even though you could solve it yourself, because it's the same code with a slightly different method of doing it.
So get a good book. Read it. Understand the language. Then go back and look over your code and see if it makes sense.

15. Learning C++ is too difficult to do by guessing. Find a reference source of some kind.