Thread: Struggling With the Next Step.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Normally, you'd want a loop (for loop perhaps), that would loop three times. First time, a variable would be at .35, next time at .75, and then at .95. One or more if statements could be used to handle this logic.
    Code:
    if(i == 0) 
       variableName = .35;
    else if(i == 1)
       variableName = .75;
    //etc.
    Inside the loop, you would include a print statement to output the needed info.

  2. #2
    Registered User
    Join Date
    Nov 2013
    Posts
    8
    Quote Originally Posted by Adak View Post
    Normally, you'd want a loop (for loop perhaps), that would loop three times. First time, a variable would be at .35, next time at .75, and then at .95. One or more if statements could be used to handle this logic.
    Code:
    if(i == 0) 
       variableName = .35;
    else if(i == 1)
       variableName = .75;
    //etc.
    Inside the loop, you would include a print statement to output the needed info.
    Havent done much work on loops yet so will have to try research it, this question is really killing me, our lecturer is one of those who just expects you to know what to do without explaining the basics.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 03-08-2013, 03:16 AM
  2. Step by step read data from exe file to memory.
    By JoBlack in forum C++ Programming
    Replies: 1
    Last Post: 06-23-2012, 02:02 PM
  3. Replies: 4
    Last Post: 05-26-2011, 06:51 AM
  4. multiplying step by step
    By Martin0027 in forum C Programming
    Replies: 1
    Last Post: 05-18-2011, 11:03 AM
  5. why does the memory increase step by step?
    By zcrself in forum C Programming
    Replies: 9
    Last Post: 07-14-2010, 12:04 AM