Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 otherimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions