Thursday, 4 September 2014

conditional multiplication of rates as per increase count

What is best approach and coding practice for my below requirements:
As I have user records in my table, and I want to charge user as per conditional basis
Condition is, If user has 20 record then system will charge by 500 USD per record If user has 30 record then System will charge then system will charge 500 USD per record for 20 records and 300 USD for next 10 records also If user has more than 30 records then charges then calculation will be (20 * 500 + 10 * 300 + addition-records * 100 )

Record Table

Post(:id, :content, :user_id)

I have also subscription table where I manage charges
I will appreciate If coders will uses constant for static values, like
$ {1 to 20 => 500, 20 to 30 => 300, 30 to x => 100 } ...etc

3 comments:

  1. Hi buddies, it is great written piece entirely defined, double angle trig identity

    ReplyDelete
  2. The context of this content is really good .thankful to you for sharing this type of awareness with us. In this article you shared many informative knowledge on multiplication activity. Free Math Games for Kids

    ReplyDelete
  3. The delightful article you have posted here. This is a good way to increase our knowledge. Continue sharing this kind of articles, Thank you.mental math for kids

    ReplyDelete