The object of this assignment is to familiarize yourself with some of the basics of C: arrays, functions, complex switch statements and of course I/O. (There are no donuts to be counted for this assignment) The assignment is due February 18th at 1:59 pm. The assignment will be turned in electronically via the turnin command. The name for the assignment is 352assign2, so when you are ready to submit your solutions, you'll need to do: turnin 352assign2 map.c where map.c contains the C source code for your assignment Scenario: You are going to go visit a whole bunch of foreign countries you've never been to! You are going to Europe, Asia, Mars: someplace cool. Where you're going, there are going to be a lot of countries that you want to visit, and you need to know what countries are adjacent (by adjacent, we simply means that two countries share a common border) to other countries so you can plan your trip. Of course, you plan to use this program the NEXT time you go someplace weird, so you want to make a program that's general. You need to be able to: 1. Enter a map. The map will simply indicate what countries are connected to other countries. Each time you run the program, you want to be able to enter a new map (so you can use a map of Europe on one run, and a map of Mars on another run). 2. Query adjacencies. You want to be able to see what countries are immediately adjacent to a specific country. For example, if you are tired of Germany, you want to see what other countries are nearby! 3. Print adjacencies. Simply show all possible adjacencies. Problem Overview Your program will be a menu-driven program (much like the ones we have seen in class) to enter/query a map. For simplicity, we will represent countries by numbers, namely ints. Country numbers will ALWAYS be positive (and never zero). When you run the program, you should be presented with a menu that looks EXACLY like the following: ***MAIN MENU*** (C) Connect two countries (D) Disconnect two countries (P) Print all connections between countries (Q) Query all connecting countries (X) Exit the program --- Please enter the first letter of your choice, then hit Return. The input will be read from the standard input (which will be the keyboard unless we redirect a file into it). Note that the cursor will be on a different line than the prompt. This will be the case for all inputs to the program. --CONNECT If users choose Connect, they should be prompted with: Please enter the two numbers of the countries you wish to connect. After entering two numbers (integers), the program should return to the main menu (after updating the connections, of course). If the user inputs a connection that already exists, then the map should not need to change. Do NOT print out any messages indicating that the connection already exists. Simply return to the main menu. --DISCONNECT If the users choose Disconnect, they should be prompted with: Please enter the two numbers of the countries you wish to disconnect. After entering the two numbers (integers), the program should return to the main menu (after deleting a connection, of course). If the user tries to delete a connection that doesn't exists between countries, the program should output on the standard error (yes stderr): Country %d and country %d are not connected. Returning to the main menu. (Obviously, the %ds should be replaced by the countries in question). Then, it should simply return to the main menu without changing the map. --PRINT If the users choose Print, then for each country that has connections, a line should be printed showing all the countries it is adjacent to. For example, if country 1 is adjacent to countries 2 and 3, and country 3 is adjacent to country 4, you would see the following: Country 01: 02 03 Country 02: 01 Country 03: 01 04 Country 04: 03 If no countries are adjacent to any other countries (which happens when the program first starts), nothing should be printed. Note that the countries should be listed in increasing order. Note that the country connections should also be listed in increasing order. After completing the print, the program should return to the main menu. --QUERY ABOUT CONNECTING COUNTRIES If the users choose this query, they should be prompted with: Please enter the number of the country you wish to see the connections for. At this point, the user enters the number of some country (an integer). If the entered country is not adjacent to any other countries, then the program should output nothing, then return to the main menu. If that country is adjacent to other countries, it should just output one line. For example, if country 1 is adjacent to countries 4 and 5, the program should output: Country 01: 04 05 Note that the country connections should be listed in increasing order. HINT: You should be able to use the same code for this and the Print. --EXIT If the user chooses exit, you should simply exit the program. NOTES: Some sample inputs and outputs will be put in ~cs352/spring08/assign2 Be watching that area for more samples. Don't put any effort into eliminating Whitespace. The scanf will do this for us for free. Besides, your input will only be chars for the menu and ints for the countries, so you shouldn't need to do much work for this. Grading is only partially based on whether or not the program works. Style, format and documentation are also factors in grading. (You probably should be using functions, eh?) We expect only valid input (except trying to disconnect two countries that aren't adjacent). You can assume there will never be more than 100 countries. You can assume that a country (on some map you have enetered) can be adjacent to all countries. Thus, there is no limit (except 100) on how many countries a specific country can be connected to.