Results 1 to 9 of 9
Thread: IF / ELSE Rules
- 11-14-2012, 03:58 PM #1
Member
- Join Date
- Nov 2012
- Posts
- 5
- Rep Power
- 0
IF / ELSE Rules
First I'm not writing code ...but I hope someone can help me with IF / ELSE / AND / OR rules if possible.
I am doing a piece of work/analysis where I have to put [TAGS] in letters based on the scenario we send to an applicant who wants a sports award, (financial).
This will go to a java developer to build.
I haven't a great deal of experience.
The letter text sent will depend on the rule …
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
So we have a rule that says you don’t need to do anything (we’ll assume no changes). See [ELSE] at bottom.
<<Basically this is if your salary falls between a particular band say 10k to 20k and you have a dependent child that we have proof for>> BUT …
[IF SALARY.ASSESSED is BAND B]
<<where salary assessed is the entity and BAND B (20k to 30k) is the attribute.>>
Send TEXT A or B in letter
Where TEXT A = [DEPENDENT.ASSESSED = 16 – 20]
The actual text is something like: You have a dependent who has turned 16 and are no longer an eligible dependent so send us proof of this dependency being extended (to <21 Yrs) or details of a new dependent <16 OR >16 and <21.
[OR]
Where TEXT B =
You have a dependent who turned 21 yrs and is no longer an eligible dependent so send us proof of a new dependent <16 OR >16 and <21.
Some static text goes here…
[ELSE]
SIGN THE DOC TO CONFIRM NO CHANGES
[ENDIF]
I’ll have a stab at it but can someone confirm if this code/tag works…
You don’t need to do anything to get award
[IF SALARY.ASSESSED = BAND B]
[AND]
[DEPENDENT.ASSESSED = 16 – 20]
Text A here.
[OR]
[DEPENDENT.ASSESSED = 21 +]
Text B here.
[ELSE]
SIGN THE DOC TO CONFIRM NO CHANGES
[ENDIF]
Some static text goes here…
Thanks for any help. I appreciate any feedback.
- 11-14-2012, 04:21 PM #2
Re: IF / ELSE Rules
You're going to have to write code that tests your assumptions. No way around it. We aren't going to write code for you, run it for you, and report back our findings. If you want to see if your code works, then you're going to have to run it.
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 11-14-2012, 04:29 PM #3
Member
- Join Date
- Nov 2012
- Posts
- 5
- Rep Power
- 0
Re: IF / ELSE Rules
Sorry I've no experience of coding as that's not what I do. I've been fortunate or unfortunate enough to have a piece of work where letter tags issue particular text.
I was trying to see if what I thought made sense.
Sorry for wasting your time :)
- 11-14-2012, 04:31 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: IF / ELSE Rules
That [OR] should be an [ELSE IF] since it involves doing something.
The structure is:
where 'x' and 'y' are boolean expressions involving AND and OR.Java Code:IF x do something ELSE IF y do something else ELSE do yet a different thingPlease do not ask for code as refusal often offends.
- 11-14-2012, 04:50 PM #5
Member
- Join Date
- Nov 2012
- Posts
- 5
- Rep Power
- 0
Re: IF / ELSE Rules
Ah cool Tolls.
Thanks for that it think it makes sense to me now.
So the 'AND' is correct and it should be ...
[IF SALARY.ASSESSED = BAND B]
[AND]
[DEPENDENT.ASSESSED = 16 – 20]
Text A here. This text will be sent!
[ELSE IF]
[DEPENDENT.ASSESSED = 21 +]
Text B here. This text will be sent!
[ELSE]
SIGN THE DOC TO CONFIRM NO CHANGES
[ENDIF]
Some static text goes here…
- 11-14-2012, 05:30 PM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: IF / ELSE Rules
I suspect the else-if should have an AND for the salary.assessed, otherwise that implies Text B will go out for anyone with a Dependent 21+?
Please do not ask for code as refusal often offends.
- 11-15-2012, 09:28 AM #7
Member
- Join Date
- Nov 2012
- Posts
- 5
- Rep Power
- 0
Re: IF / ELSE Rules
So...we only want to send either
A - your salary is x so send info because you have dependent who is (turned) 16 - so no longer a dependent.
OR
B - you salary is x so send info because you have a dependent who is (turned) 21 - so no longer a dependent.
OR
C - sign the doc and return
So if we add an AND do you mean where I have it below?
[IF SALARY.ASSESSED = BAND B]
[AND]
[DEPENDENT.ASSESSED = 16 – 20]
Text A here. This text will be sent!
[AND] (put 'AND' here?)
[ELSE IF]
[DEPENDENT.ASSESSED = 21 +]
Text B here. This text will be sent!
[ELSE]
SIGN THE DOC TO CONFIRM NO CHANGES
[ENDIF]
Some static text goes here…
Thanks. J
- 11-15-2012, 09:47 AM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: IF / ELSE Rules
The ELSE IF is just a normal if statement.
Exactly the same as the first IF, but with a dependent 21+.
Remember my structure above, there are no ANDs or ORs except in the 'x' and 'y' expressions.Please do not ask for code as refusal often offends.
- 11-16-2012, 09:45 AM #9
Member
- Join Date
- Nov 2012
- Posts
- 5
- Rep Power
- 0
Similar Threads
-
Architecture Rules 2.1.1
By Java Tip in forum Java SoftwareReplies: 0Last Post: 07-11-2008, 02:39 PM -
Architecture Rules 2.1.0
By Java Tip in forum Java SoftwareReplies: 0Last Post: 07-05-2008, 06:18 PM -
any can help me? About MDAS and PEMDAS rules and Infix-Prefix, Infix-Postfix rules
By darlineth in forum New To JavaReplies: 1Last Post: 07-05-2008, 03:08 PM -
Architecture Rules 2.0.1
By JavaBean in forum Java SoftwareReplies: 0Last Post: 11-17-2007, 02:03 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks