Question: Using C++ write the following assignment making sure a list of residents is available without imputing anything and making sure 5 years are simulated 1

Using C++ write the following assignment making sure a list of residents is available without imputing anything and making sure 5 years are simulated 1 after the otherUsing C++ write the following assignment making sure a list of residents

Photos - d5c60151-a3e0-4933-b986-73a573904303.jpg See all photos + Add to A % Edit & Create Share A Problem: People living in Turkey are classified as locals and foreigners. For locals, we are interested in the TC ID, name, age, and city of residency. For foreigners, we are interested in the TC ID, name, age, number of years spent in Turkey, their country of origin, and city of residency in Turkey. a) Define a base class and a derived class to represent residents (local and foreign) of Turkey. The data described above should be in the private part of the classes. b) Add in each of the classes a constructor to set the values of its variables to corresponding parameters passed in the header. c) Add to each class a print function to print all possible characteristics of objects of that class-type. d) Add to each class a read function to input all possible characteristics of objects of that class-type. e) Add an overloaded function for pre-increment (++) to increase the age of a person by 1. For foreigners, the function should also increase the number of years spent in Turkey by 1. f) Add to each class a function to change the city of residency of a person. Note that all functions are to be added to the public part of the classes. Write a test program to simulate the following scenario: Create a list of residents with at least 5 locals and 5 foreigners. Simulate the movement of residents for 5 years: o Each year, at least one foreigner or local is leaving the country and a new foreigner is coming to Turkey. Each year, at least one local and one foreigner change their city. Each year, update the ages and years of residency for all residents. o Print the current information of all residents at the end of each year. O o L OneDrive Screenshot saved The screenshot was added to your OneDrive. . Type here to search o 15C E 15:55 27/12/2021 18

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!