Starting from:
$30

$24

Homework #9 Solution




Write a C program that keeps information about world countries. There could be at most 100 countries. Use C Structures with the following data fields to represent countries.




Country name (at 25 characters),
Country population,
Country area in km squares,
Number of soldiers in the army,
Neighbor countries (at most 10 neighbors, 0 for island countries)



When your program runs, it should offer the following options




Add a country (if user presses corresponding key, in this case: ‘a’), (Type ‘-1’ to finish neighbor input )



Print name of the most powerful country in terms of military strength in vicinity of a given country (among neighbors of neighbors of given country including itself )



Print name of the largest country in terms of land it possesses in vicinity of a given country (among neighbors of neighbors of given country including itself )



Calculates and prints how many people at minimum should be seen if I need to go from a given country to another given country (Assume that if I visit a country, I would see all people of that country). If the target country is inaccessible then print INACCESSIBLE.



Exit the program (Presses key ‘e’)












Sample Usage




Make your choice:




a




Turkiye




79000000




815000




640000




Azerbaycan




Bulgaristan




Ermenistan




Gurcistan




Irak




Iran




Suriye




Yunanistan




-1




Make your choice:




b




Turkiye




<outputTurkiye




Make your choice:




c




Turkiye




<outputTurkiye




Make your choice:




d




Turkiye Bulgaristan




<outputINACCESSIBLE




Make your choice:




e




<outputGood Bye










#notes




You should send your main function completely.



The assignment must be your original work. Duplicate or very similar assignments are both going to be considered as cheating.



Ask your questions via moodle.

More products