Results 1 to 2 of 2
  1. #1
    valoyivd is offline Member
    Join Date
    Mar 2008
    Posts
    8
    Rep Power
    0

    Default avoiding if statements

    If Quote.schemeType = B and QuoteInput.adminInclusive = FALSE and QuoteInput.riskInclusive = FALSE . AND
    If (QuoteInput.AdminPerc + QuoteInput.renewalCommPerc) / Total scheme cost > 15%

    If Quote.schemeType = B and QuoteInput.adminInclusive = FALSE and QuoteInput.riskInclusive = TRUE . AND
    if (QuoteInput.AdminPerc + QuoteInput.renewalCommPerc) / Total scheme cost > 15% then generate this part of the report.

    If Quote.schemeType = B and QuoteInput.adminInclusive = FALSE and QuoteInput.riskInclusive = FALSE . AND

    If (QuoteInput.AdminPerc + QuoteInput.renewalCommPerc) / Total scheme cost > 15% then generate this part of the report.
    I have more than 12 of this if statements...I think using if statements will make my code cluttered so I want a simple way that will make my code readable while doing the checks...Thanks

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Not clear with you code me. But in general for if loop you can use switch-case as well. But you may have to re-factor the code to use it. Normally in design level it should be done.

Similar Threads

  1. Help with actionPerformed Statements
    By wco5002 in forum New To Java
    Replies: 8
    Last Post: 03-26-2008, 04:02 AM
  2. Replies: 0
    Last Post: 09-28-2007, 12:59 PM
  3. How to reduce the size or avoiding out of memory error?
    By rajeshkumarmsc in forum Advanced Java
    Replies: 3
    Last Post: 08-11-2007, 10:15 PM
  4. Help with if else statements
    By zoe in forum New To Java
    Replies: 1
    Last Post: 07-24-2007, 07:56 PM
  5. Problems with packages (import statements)
    By ai_2007 in forum Advanced Java
    Replies: 1
    Last Post: 06-29-2007, 11:57 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
  •