90 142
Assignments Done
99.4%
Successfully Done
In September 2020

Answer to Question #22460 in Java | JSP | JSF for srikanth

Question #22460
The function will return true if and only if a passport holder satisfies following conditions-

A passport holder should not be a criminal.
A passport holder must have only one nationality and it should be &quot;Indian&quot;.
A passport holder must be living at current address for more than 12 months.
A valid passport holder must hold at least two degrees from the list: &quot;High School&quot;. &quot;Intermediate&quot;, &quot;Graduate&quot;, &quot;Professional&quot;

Write a method:

boolean isValidIndianPassportHolder(boolean isCriminal, String[] nationalities, float livingMonths, String[] qualifications);

isCriminal Value of this variable will be true, if passport holder is criminal otherwise false
nationalities A string array of nationalities which cannot be null
livingMonths This variable defines the number of months the passport holder was living at the given address
qualifications This variable defines a string array which defines qualifications (e.g. &iuml;&iquest;&frac12;High School&iuml;&iquest;&frac12;, &iuml;&iquest;&frac12;Intermediate&iuml;&iquest;&frac12;, &iuml;&iquest;&frac12;Graduate&iuml;&iquest;&frac12;), of th
1
2013-01-21T11:59:48-0500
boolean isValidIndianPassportHolder(boolean isCriminal,String[] nationalities, float livingMonths, String[] qualifications){
if(isCriminal)
returnfalse;
if((nationalities.length!= 1) || (!nationalities[0].equals("Indian")) )
returnfalse;
if(livingMonths<= 12)
returnfalse;
if(qualifications.length< 2)
returnfalse;
StringqualificationsList[] = {"High School", "Intermediate",
for(inti = 0; i < 2; i++){
booleanholdsDegree = false;
for(Stringq : qualifications){
if(q.equals(qualificationsList[i])){
holdsDegree= true;
break;
}
}
if(!holdsDegree)return false;
}
returntrue;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!