I am supposed to compute the quantity for an array of values. I'm having trouble writing the correct code to do so. I have some code written, but the output values are incorrect it seems. Also, I am so supposed to return the resulting value, via explicit return statement, to the main program, and I have no idea how to do this exactly. Any suggestions?
I meant to cout 'Q'. My mistake. But, I'm supposed to return Q, and have a cout statement. When I try to do this, it says "error-return statement with a value".
Okay, I am now getting the correct output without putting the return statement. But, the instructions say to put the return statement. Here is what I have now.
Change the return type from void to the type of value you want the function to return. In this case, change it todouble as shown in one of the earlier posts here.
That got it fixed. Thanks a lot guys. My instructor throws all of this material at us that we haven't went over completely yet, so a lot of my knowledge on this is just trial and error, so I apologize if I sound ignorant in any way. Thanks again.