Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct ADDRESS {
- string street;
- string city;
- string parish;
- string country;
- };
- struct APPLICANT {
- string first_name;
- string last_name;
- string dob;
- ADDRESS address;
- };
- int main() {
- APPLICANT applicant;
- cout << "Enter an applicant's details" << endl;
- cout << "First Name\n";
- getline(cin, applicant.first_name);
- cout << "Last Name\n";
- getline(cin, applicant.last_name);
- cout << "Date of Birth\n";
- getline(cin, applicant.dob);
- cout << "Street address\n";
- getline(cin, applicant.address.street);
- cout << "City\n";
- getline(cin, applicant.address.city);
- cout << "Parish\n";
- getline(cin, applicant.address.parish);
- cout << "Country\n";
- getline(cin, applicant.address.country);
- // Print out the details
- cout << "\n\nFirst Name: " << applicant.first_name << endl;
- cout << "Last Name: " << applicant.last_name << endl;
- cout << "Date of Birth: " << applicant.dob << endl;
- cout << "Street address: " << applicant.address.street << endl;
- cout << "City: " << applicant.address.city << endl;
- cout << "Parish: " << applicant.address.parish << endl;
- cout << "Country: " << applicant.address.country << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment