Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

South_Africa Bloemfontein 1395 India Bangalore 920 India Chennai 6 India Hyderabad 542 Italy Milan 122 South_Africa Pretoria 1339 Albania Tirana 110 Austria Vienna 170 Belarus

South_Africa Bloemfontein 1395 India Bangalore 920 India Chennai 6 India Hyderabad 542 Italy Milan 122 South_Africa Pretoria 1339 Albania Tirana 110 Austria Vienna 170 Belarus Minsk 198 Belgium Brussels 13 Bosnia_and_Herzegovina Sarajevo 577 Bulgaria Sofia 591 Canada Edmonton 645 Croatia Zagreb 130 Czech_Republic Prague 244 Denmark Copenhagen 10 Estonia Tallinn 37 Finland Helsinki 25 France Paris 34 Mexico Toluca 2660 Germany Berlin 34 Greece Athens 153 Hungary Budapest 102 Ireland Dublin 8 Italy Rome 14

PROMPT IS

Write a C++ Program to implement a balanced Binary Search Tree using Set and Map from the standard template library. The data file is under Assignment05 in Files (Cities_Sea_Level.data). The format of the data is as follows and it contain Country, City and Elevation from sea level in meters.

Country/Territory City_Name/s Elevation (m)

1. Read City from the file and create a Set using STL. 2. Give option to search a City in the Set data structure as user input. 3. Read City and Elevation as a Map data structure using STL. 4. Give user option to search for a city and retrieve the elevation. Print a message if the City is not found in the Map.

image text in transcribed

output should look like this

would you like to search for a city in a Set or a Map? Enter 1 for Set, 2 for Map, o to exit: 1 Enter a city to search for in the Set: Ho_Chi_Minh_City Ho_Chi_Minh_City has been located in the set! Would you like to search for a city in a Set or a Map? Enter 1 for Set, 2 for Map, o to exit: 2 Enter a city to search for in the Map: Ho_Chi_Minh_City City: Ho_Chi_Minh_City Elevatiom: 19 would you like to search for a city in a Set or a Map? Enter 1 for Set, 2 for Map, o to exit: 1 Enter a city to search for in the Set: Ho_Chi_Minh_City Ho_Chi_Minh_City has been located in the set! Would you like to search for a city in a Set or a Map? Enter 1 for Set, 2 for Map, o to exit: 2 Enter a city to search for in the Map: Ho_Chi_Minh_City City: Ho_Chi_Minh_City Elevatiom: 19

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

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions

Question

JustifyTHREE ( 3 ) individual characteristics of RISC and CISC

Answered: 1 week ago

Question

=+j Understand different types of regions in the world.

Answered: 1 week ago