Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   I am having a seriosly difficult time in programming c++ (http://www.go4expert.com/forums/i-seriosly-difficult-time-programming-t21523/)

husseinballard 25Mar2010 23:46

I am having a seriosly difficult time in programming c++
 
This is c++
This is one of the practice questions I am faced with :

Fill in the blank, so that this code sums only the high temperature!
// 0 is high, 1 is low
the problem is sum=0;
for (k=0; k<50; k++)
for (j=0; j<7; j++)
sum= sum + _______________

My answer is sum= sum+j++,and J++
I have been told this is incorrect
I have been looking at this code and I do not see enough information to answer this question There aren't any real temps. Please tell me what you think

davidk 26Mar2010 12:51

Re: I am having a seriosly difficult time in programming c++
 
Is this the whole code? Please use tags
Code:

and
.
Also, could you please tell about the problem more precisely. What did you try to solve the trouble and why?
Nothing is clear in your post.

xpi0t0s 26Mar2010 15:14

Re: I am having a seriosly difficult time in programming c++
 
There isn't enough information to answer the question. The question refers to high temperature; are there some temperature values stored in an array (say, a 7 by 50 element array) that you haven't told us about?

Have a look through the whole paper. You might find a section that says something along the lines of "for the following questions you will need this data..."


All times are GMT +5.5. The time now is 17:23.