Assume you have a system with the followoing entities Region ID, Len, Width int Area ()//zero City Country T. ID, Len, Width Area () ID, Len, Width city *A//array of cities Area () 1. Implement the above system using inheritance in the best possible way. Keep every object size as small as possible. Implement all methods (setter/getter/constructors and destructors) Note that the region area is 0 while the city is len"width and the country is the sum of their cities. 2. Create array of countries called Arab of 22 countries. Write a function fill that fills the array Arab 3. Write a method that finds the city that has the max area in a country 4. Write a method that sorts the cities in a country from the largest to the smallest area 5. Write a function that returns array of countries of the same area of Arab 6. Write a function that compares between two countries. It returns true if countryl area greater than country2 area. 7. Write a function to move a city from one country to another.
Assume you have a system with the followoing entities Region ID, Len, Width int Area ()//zero City Country T. ID, Len, Width Area () ID, Len, Width city *A//array of cities Area () 1. Implement the above system using inheritance in the best possible way. Keep every object size as small as possible. Implement all methods (setter/getter/constructors and destructors) Note that the region area is 0 while the city is len"width and the country is the sum of their cities. 2. Create array of countries called Arab of 22 countries. Write a function fill that fills the array Arab 3. Write a method that finds the city that has the max area in a country 4. Write a method that sorts the cities in a country from the largest to the smallest area 5. Write a function that returns array of countries of the same area of Arab 6. Write a function that compares between two countries. It returns true if countryl area greater than country2 area. 7. Write a function to move a city from one country to another.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 19RQ
Related questions
Question
![Assume you have a system with the followoing entities
Region
ID, Len, Width
int Area ()//zero
City
Country
T.
ID, Len, Width
Area ()
ID, Len, Width
city *A//array of cities
Area ()
1. Implement the above system using inheritance in the best possible way. Keep every object size
as small as possible. Implement all methods (setter/getter/constructors and destructors) Note
that the region area is 0 while the city is len"width and the country is the sum of their cities.
2. Create array of countries called Arab of 22 countries. Write a function fill that fills the array
Arab
3. Write a method that finds the city that has the max area in a country
4. Write a method that sorts the cities in a country from the largest to the smallest area
5. Write a function that returns array of countries of the same area of Arab
6. Write a function that compares between two countries. It returns true if countryl area greater
than country2 area.
7. Write a function to move a city from one country to another.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F97476ba8-c1fb-4519-8cd3-6bc3810448b5%2F5a23de88-4c0d-4b99-9c5f-e1aac94527e1%2Fmngq8cp.jpeg&w=3840&q=75)
Transcribed Image Text:Assume you have a system with the followoing entities
Region
ID, Len, Width
int Area ()//zero
City
Country
T.
ID, Len, Width
Area ()
ID, Len, Width
city *A//array of cities
Area ()
1. Implement the above system using inheritance in the best possible way. Keep every object size
as small as possible. Implement all methods (setter/getter/constructors and destructors) Note
that the region area is 0 while the city is len"width and the country is the sum of their cities.
2. Create array of countries called Arab of 22 countries. Write a function fill that fills the array
Arab
3. Write a method that finds the city that has the max area in a country
4. Write a method that sorts the cities in a country from the largest to the smallest area
5. Write a function that returns array of countries of the same area of Arab
6. Write a function that compares between two countries. It returns true if countryl area greater
than country2 area.
7. Write a function to move a city from one country to another.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 7 steps with 16 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,