Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3452858
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:18:26+00:00 2026-05-18T09:18:26+00:00

I am writing the spacifications for a new feature in our application. Now what

  • 0

I am writing the spacifications for a new feature in our application.
Now what we want to do is whenever a message for trasfers is sent by client in a specific currency we need to divide between one or more banks.

80 % to bank A and 20% to bank B etc each time a transfer message is sent. We need to build this in our db (sql 2005) so that if the percentage change for us to be able to change that.
I am having difficulty writing the spec for the calculation of when the 80% of messages will be sent to BANK A and when the 20% will be sent to bank b based on the perecentage we have in our db. I initially thought of implenting a counter that counts the messages and then doing a calculation based on the percentage but not sure of the algorythm. can you help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T09:18:27+00:00Added an answer on May 18, 2026 at 9:18 am

    If you don’t need the results to be guaranteed, you could simply base the routing on a random number generator:

    var r = rand() // assume it yields a decimal between 0.0 and 1.0
    if (r < 0.2) sendToBankB()
    else         sendToBankA()
    

    The above is obviously hard-coded and simplified for just two banks, but I think you could see how to generalize it for N banks with N percentages: sort by percentage and test the array in increasing order.

    If you do need to be exact about it (send four to Bank A and the fifth always to Bank B) then I think you will need to implement a counter. The most important question in my mind for this is:

    • If you have odd ratios that don’t reduce nicely (say 51% and 49%), is it OK to send 51 to Bank A and then 49 to Bank B, or would you want to alternate sends up until the last?

    In general, look to first reduce your ratios by dividing by the greatest common divisor, and then either send the right number of messages to each bank sequentially, or shuffle all the results together along the same repetition period.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Writing a client application that sends images to a server via a webservice. As
For a new application I want to start dabbling in BDD and I'm trying
Writing a .NET DLL how do I find Application.ProductName ? EDIT: Obviously, importing Windows.Forms
Writing my first C# application...never touched the language before and not much of a
Right now I'm writing my PhD proposal to build a language processor for a
I am writing php client for .Net web service which uses ws.* specification. In
I have a client/server set up and I want my client to know if
I am trying to develop an XML export feature to give my application users
I am currently writing the specification for an API that works as follows: Client
I don't have any experience in writing Requirement specification. I am writing a new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.