Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c++ please be careful for the simulation part requirements Problem: People living in Turkey are classified as locals and foreigners. For locals, we are

image text in transcribed

in c++ please be careful for the simulation part requirements

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. Print the current information of all residents at the end of each year

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

Step: 3

blur-text-image

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

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

analog and digDigital defidefinition

Answered: 1 week ago

Question

Understanding Groups

Answered: 1 week ago