I am having a seriosly difficult time in programming c++

Discussion in 'C++' started by husseinballard, Mar 25, 2010.

  1. husseinballard

    husseinballard New Member

    Joined:
    Mar 25, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  2. davidk

    davidk New Member

    Joined:
    Mar 25, 2010
    Messages:
    16
    Likes Received:
    1
    Trophy Points:
    0
    Home Page:
    http://www.firmdev.com/firm_framework
    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.
     
  3. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    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..."
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice