Code:
<?php // Place my work here, between the opening and closing tags.
/*******************************************************************
The code below initializes three (3) arrays:
1. $countries is a list of countries.
2. $un_secretaries contains the names of current and former
secretaries-general of the UN; their native country is the key
to the array.
3. $nobel_winners contains some of the countries which have
produced Nobel Peace Prize winners some time in the last 20
years.
My job is to loop through the $countries array and determine...
1. ...whether each country has produced a UN
secretary-general; if so, print his name;
2. ...whether each country has produced a Nobel Peace
prize winner. If so, print a statement that says so.
*******************************************************************/
$countries = array(
'China', 'Costa Rica',
'Austria', 'Australia',
'Ghana', 'Guatamala',
'Canada', 'South Korea',
'Iran', 'Ethopia',
'Japan', 'Myanmar',
'France', 'Finland'
);
// Initialize array with UN secretaries-general.
$un_secretaries = array(
'South Korea' => 'Ban Ki-moon',
'Ghana' => 'Kofi A. Annan',
'Egypt' => 'Boutros Boutros-Ghali',
'Peru' => 'Javier Perez de Cuellar',
'Austria' => 'Kurt Waldheim',
'Myanmar' => 'U Thant',
'Sweden' => 'Dag Hammarskjöld',
'Norway' => 'Trygve Lie'
);
// Initialize array with some countries that have produced
// Nobel Peace prize winners.
$nobel_countries = array(
'Finland', 'Bangladesh',
'Kenya', 'Iran',
'South Korea', 'Guatemala',
'Myanmar', 'Costa Rica'
);
// Start here:
?>
Bookmarks