Results 1 to 2 of 2
Thread: avoiding if statements
- 04-02-2008, 08:38 AM #1
Member
- Join Date
- Mar 2008
- Posts
- 8
- Rep Power
- 0
avoiding if statements
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...ThanksIf 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.
- 04-02-2008, 09:08 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
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
-
Help with actionPerformed Statements
By wco5002 in forum New To JavaReplies: 8Last Post: 03-26-2008, 04:02 AM -
How to Execute SQL statements in Spring Framework
By JavaBean in forum Java TipReplies: 0Last Post: 09-28-2007, 12:59 PM -
How to reduce the size or avoiding out of memory error?
By rajeshkumarmsc in forum Advanced JavaReplies: 3Last Post: 08-11-2007, 10:15 PM -
Help with if else statements
By zoe in forum New To JavaReplies: 1Last Post: 07-24-2007, 07:56 PM -
Problems with packages (import statements)
By ai_2007 in forum Advanced JavaReplies: 1Last Post: 06-29-2007, 11:57 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks