Hi,
I have this code for an array:

{
cout << "how many tins sold? " << (i+1) ;
cin >> tinssold;

cout << "how much is each tin?" << (i+1) ;
cin >> tinprice;
		
value=(tinssold*tinprice
cout <<"total value of tins is " <<value;
}

IF I WANTED TO PUT AN if STATEMENT BEFORE THE VALUE IS PROCESSED SAYING THAT BASICALLY IF MORE THAN 52 TINS ARE SOLD THEN THE VALUE OF EACH TIN IS DOUBLED, HOW WOULD I DO THIS, WHAT WOULD THE IF STATEMENT LOOK LIKE?

PLEASE HELP!

1) You shouldn't post in red. It doesn't alter our level of urgency, and actually annoys us. I know your reason was probably to distinguish between your code and your words, but see 3 for that.
2) Let's not post in all caps. Makes it seem like you are yelling at me, and that doesn't inspire me to be helpful.
3) Use Code Tags. when you post code, you can use them by typing (without the spaces between [ and ]):
[ code=c++ ]
// your code here
[ /code ]

Since I am fairly unsure about a number of things in your code (such as missing parenthesis, why you are adding 1 to i during your output, and whatever convinced you to use >>) however, if you are wanting to add a simple if statement, as in the one you mentioned above:

if (tinssold > 52) {
     tinprice *= 2; // multiply by two is doubled right?
}
commented: Well said. It's still horrid even without the wax crayon colouring in. +26
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.