• Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple if AND condtion  RSS feed

 
Alina Sam
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi , I have a form with the following field:
age
qualification
employment history
experience.

An officer will fill the above information. Only age is mandatory and the other field can be empty. Now once the officer save this information, I will need to retrieve the info of a user to see if it match the above. My problem is how will i build my if statement. Lets take a first scenario where all field is filled:

if(age){
  if(qualification){
     if(employmentHistory){
        if (experience){
           sysout("user is eligible");
         }
         else sysout("experience failed");
     }
     else sysout ("employmentHistoryfailed");
  }
   else sysout ("qualification failed"):
}
else
    sysout("age not in limit")


I need to build my condition like this because if age is false, its useless to continue. Now i can have a scenario where i have only age, employmentHistory and experience filled in the form. So in this case I don't even need to check for qualification. it should be removed from the if condition. How can I achieved this in clean way ? Note that age is mandatory. I should always check for age, but the others are not mandatory. It varies . I can have a lot of combination. Glad if anyone can help
 
Norm Radder
Rancher
Posts: 2240
28
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!