Final answer:
In C++, you can use nested if statements to develop a preliminary visa interview application. The program will evaluate different conditions such as nationality, employment status, purpose of travel, marital status, and age to determine whether the applicant is qualified for a visa.
Step-by-step explanation:
In C++, you can use nested if statements to develop a preliminary visa interview application. Here's an example code:
#include <iostream>
using namespace std;
int main() {
string nationality;
bool unemployed, student;
string purpose;
bool married;
int age;
cout << "Enter your nationality: ";
cin >> nationality;
if (nationality != "Nigerian") {
cout << "Apply from your own country." << endl;
return 0;
}
cout << "Are you unemployed? (1 for Yes, 0 for No): ";
cin >> unemployed;
if (unemployed && !student) {
cout << "Application rejected." << endl;
return 0;
}
cout << "Enter the purpose of your travel: ";
cin >> purpose;
if (purpose != "visiting" && purpose != "studying") {
cout << "Visa denied." << endl;
return 0;
}
cout << "Are you married? (1 for Yes, 0 for No): ";
cin >> married;
cout << "Enter your age: ";
cin >> age;
if (married || (age >= 18 && age <= 25)) {
cout << "Visa granted." << endl;
}
else {
cout << "Visa denied." << endl;
}
return 0;
}
By running this code, you can input the necessary information and the program will determine whether the applicant is qualified to apply for a visa based on the given conditions.