% Script for Assignment 3
close all % close all openned figure windows

transportData = readTransportData('TransportData.csv');

[areas,locations] = splitTimeZones(transportData);

[countries,countryIDs,uniqueAreas,areaIDs,airportIDs] = ...
indexAirports(transportData, areas);

rEarth = 6378.1; % Earth's radius in km
distances = tabulateDistances(transportData, rEarth); % distances in km

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Do not modify the code above. %%%%%
%%%% Add code below to complete the questions and %%%%%
%%%% tasks posed in the Assignment 3 document. %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% 1. How many airports are recorded in this data set?

nAirports = length(airportIDs);

fprintf('\n')
fprintf('1. There are %d airports recorded in this data set.',nAirports)
fprintf('\n')

%% 2. Determine the number of countries that have at least 1 airport
% recorded in this data set.

%% 3. Consider the top 30 countries with the most number of airports
% recorded in the data set. Draw a bargraph to show the number of airports
% recorded per country for those that are in the top 30.

%% 4. Draw a piechart to illustrate the proportion of airports in each time
% zone.

%% 5. Determine which airports are closest and farthest from each other.
% Print the answers neatly with their corresponding distance and
% corresponding countries.

%% 6. Determine the airport with the largest altitude for each time zone.
% Print your results neatly with the corresponding altitude (in ft) and
% corresponding country.