Results 1 to 3 of 3
  1. #1
    jdepp is offline Member
    Join Date
    Mar 2017
    Posts
    4
    Rep Power
    0

    Default logic to validation process

    I am new to Java and would like to crate an application that validates credit card transactions against its predetermined limit. I have set out my algorithm and although it seems pretty straight forward I am a bit puzzled on the following requirement. The string passed to the validation method will contain the necessary information like cc number, transaction amount and will be checked against a max credit limit of $100000. But the confusing part for me is to check whether the limit has been exceeded or reached within the last 24 hours, meaning I need to keep track of all transactions within that time period.

    Java Code:
    public boolean isLimit(String ccDetails) {
    
    <begin>
    
         string parse the cc number from string
         pass string to validate cc.number method
         if valid then
            continue
         else 
            return false 
         parse string transaction amount
         create instance of cc
         if cc.amount >= cc.limit
            return true
         else
             add cc.amount to cc.totalTransactions
         end if
    
    }
    
    I realize that this is very generic but just want to get the business logic first before coding.
    Advice appreciated.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    24

    Default Re: logic to validation process

    You didn't bother to reply to SurfMan's two responses in your earlier thread. Why should we expect anything better here?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    jdepp is offline Member
    Join Date
    Mar 2017
    Posts
    4
    Rep Power
    0

    Default Re: logic to validation process

    Quote Originally Posted by DarrylBurke View Post
    You didn't bother to reply to SurfMan's two responses in your earlier thread. Why should we expect anything better here?

    db

    Sorry I did not see any earlier responses and did not realize an earlier thread was posted as the page kept reverting to login screen even after I logged in. Besides I am working on the code now and will post back. I realize as well that my question was not researched prior to posting and a simple db table would be the approach to store transactions.

Similar Threads

  1. Where´s the logic?
    By fmmoss in forum New To Java
    Replies: 2
    Last Post: 01-10-2017, 03:39 PM
  2. Where´s the logic?
    By fmmoss in forum Forum Lobby
    Replies: 1
    Last Post: 01-10-2017, 01:19 PM
  3. Need help with input validation, loop logic
    By mwr1976 in forum New To Java
    Replies: 1
    Last Post: 02-06-2012, 10:07 AM
  4. need a logic for this
    By rajivjoshi in forum New To Java
    Replies: 4
    Last Post: 06-12-2010, 02:18 PM
  5. Cant get the logic right
    By jermaindefoe in forum New To Java
    Replies: 4
    Last Post: 03-11-2008, 12:22 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
  •