60 622
Assignments Done
97,8%
Successfully Done
In April 2018

# Answer to Question #21940 in C# for Nandakumar

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

1.A passport holder should not be a criminal.
2.A passport holder must have only one nationality and it should be &quot;Indian&quot;.
3.A passport holder must be living at current address for more than 12 months.
4.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;Graduat
bool isValidIndianPassportHolder(bool isCriminal, string[] nationalities, float livingMonths, string[] qualifications)
& {
if (isCriminal) return false;

if(nationalities.Length != 1) return false;

if (nationalities[0] != &quot;Indian&quot;) return false;

if (livingMonths &lt; 12) return false;

int counter = 0;
foreach (string item in qualifications)
{
if (item == &quot;High School&quot; || item == &quot;Intermediate&quot; || item == &quot;Graduate&quot; || item == &quot;Professional&quot;)
& counter++;
}

if (counter &lt; 2) return false;

return true;
& }

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!