Results 1 to 1 of 1

Math Help - Quota over time

  1. #1
    Newbie
    Joined
    May 2008
    Posts
    1

    Quota over time

    Greetings,

    I am trying to programatically calculate a quota over a given period of time.

    example:

    User A needs to refer 3 friends to a my site every 3 months, starting the day they register.

    I already have:
    - the day they registered (4 months ago)
    - how many referrals they already have (4)
    - months elapsed (4)

    I am trying to calculate the required number of referrals on command. In pseudo code:

    If ( numberOfReferralsUserHas isLessThan ( numberOfMonthsRegistered / 3 ) * ){
    run some code ;
    run some more code;
    }

    I "know" the answer, but I keep drawing blank as far as the best implementation that would catch errors, like the user over exceeding the quota. I would just like to see it work first maybe that would help 'clear the fog'.

    many thanks

    solution:
    **floor(round down a float)

    referrals_needed = 3;
    If ( numberOfReferralsUserHas isLessThan ( floor( numberOfMonthsRegistered / referrals_needed ) * referrals_needed) ){
    run some code ;
    run some more code;
    }
    Last edited by nolochemical; May 24th 2008 at 11:16 PM. Reason: Wrong Forum
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 1
    Last Post: December 19th 2011, 03:27 PM
  2. Replies: 3
    Last Post: December 6th 2010, 02:52 AM
  3. Replies: 1
    Last Post: September 17th 2009, 03:51 AM
  4. Posting 2nd time(1st time didnt get anyhelp)
    Posted in the Calculus Forum
    Replies: 1
    Last Post: April 21st 2008, 08:21 PM
  5. Help with average length of time over time
    Posted in the Business Math Forum
    Replies: 0
    Last Post: March 28th 2006, 02:23 PM

Search Tags


/mathhelpforum @mathhelpforum