Results 1 to 6 of 6
  1. #1
    qwakcookie is offline Member
    Join Date
    Oct 2013
    Posts
    3
    Rep Power
    0

    Default Help for an asignment

    Hi there,

    I have an assignment in beginner java and I am a bit stumped.

    We are supposed to calculate commission pay for a transaction, on a monthly basis. The amount of transactions loop in the month until we reach an X amount. Once it hits, we move on to the next month. The calculation starts in Jan.

    I have no issues using a loop to repeat sale transactions until the amount is reached. However, I have difficulty finding a way for it to repeat the same code for next month without me manually rewriting the same code for each month. Is there a way?
    Last edited by qwakcookie; 10-01-2013 at 10:43 AM.

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default Re: Help for an asignment

    Uhm, a loop within a loop?

  3. #3
    qwakcookie is offline Member
    Join Date
    Oct 2013
    Posts
    3
    Rep Power
    0

    Default Re: Help for an asignment

    That is what i am trying now...

  4. #4
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,798
    Rep Power
    7

    Default Re: Help for an asignment

    Post code
    Post error messages
    Ask a specific question

    We don't read minds

  5. #5
    qwakcookie is offline Member
    Join Date
    Oct 2013
    Posts
    3
    Rep Power
    0

    Default Re: Help for an asignment

    After trial and error, i got the nested loop to work. Thanks.

  6. #6
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,016
    Rep Power
    6

    Default Re: Help for an asignment

    Don't call it trial and error - call it experimentation. Because that is a good thing. Give it time, eventually it will turn into primarily experience and understanding and you'll do things a lot faster.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Starting Pseudo-Code For My Asignment?
    By EpyonCustom in forum New To Java
    Replies: 26
    Last Post: 04-07-2011, 11:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •