Question #37845

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 "Indian". 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: "High School". "Intermediate", "Graduate", "Professional"
1

Expert's answer

2014-01-09T13:24:29-0500

Answer on Question #37845


#include <stdio.h>
#define twelve 12
int main () {
int criminal, nationality, nationalities, livingExperience, highSchool, intermediate, graduate, professional;
printf ("Input passport holder's criminal history presence. 1 for true, 0 for false\n");
scanf("%d", &criminal);
printf ("Input passport holder's natiaonality. 1 for Indian 0 for others.\n");
scanf("%d", &nationality);
printf ("Input quantity of passport holder's natiaonalities.\n");
scanf("%d", &nationalities);
printf ("Input quantity of passport holder's living experience in months in this country.\n");
scanf("%d", &livingExperience);
printf ("Input degrees:\n1 for High School if true, 0 if false\n");
scanf("%d", &highSchool);
printf ("1 for Intermediate if true, 0 if false\n");
scanf("%d", &intermediate);
printf ("1 for Graduate if true, 0 if false\n");
scanf("%d", &graduate);
printf ("1 for Professional if true, 0 if false\n");
scanf("%d", &professional);
if (criminal == 0 && nationality == 1 && nationalities == 1 && livingExperience > twelve && (highSchool == 1 || intermediate == 1 || graduate == 1 || professional == 1)) {
printf("true\n");
} else {
printf("false\n");
}
return 0;
}

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!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS