正在加载图片...
-12- The percentage values for ethnic groups can be represented using integers. The applications in which this structure is used require that the data type used to represent an individual country be a pointer to a record and not simply a record. Solution to 8a) 8b)Using your data structure as given in(8a),implement the function void ListByEthnicGroup(factbookDB db,string ethnicGroup); that searches the entire database of countries and displays the percentage of that ethnic group for each country in which it appears.Suppose,for example,that the variable factbook has already been initialized to contain the data for all the countries in the world.If you then call ListByEthnicGroup(factbook,"Kurdish"); you would expect to see output that looks something like this: Irag15号 Syria4号 Turkey20号 Solution to 8b)– 12 – • The percentage values for ethnic groups can be represented using integers. • The applications in which this structure is used require that the data type used to represent an individual country be a pointer to a record and not simply a record. Solution to 8a) 8b) Using your data structure as given in (8a), implement the function void ListByEthnicGroup(factbookDB db, string ethnicGroup); that searches the entire database of countries and displays the percentage of that ethnic group for each country in which it appears. Suppose, for example, that the variable factbook has already been initialized to contain the data for all the countries in the world. If you then call ListByEthnicGroup(factbook, "Kurdish"); you would expect to see output that looks something like this: Iraq 15% Syria 4% Turkey 20% Solution to 8b)
<<向上翻页
©2008-现在 cucdc.com 高等教育资讯网 版权所有