function dms_to_xy_test ( prefix )

%*****************************************************************************80
%
%% dms_to_xy_test() tests dms_to_xy().
%
%  Discussion:
%
%    Get the DMS coordinates of a set of cities, and compute
%    the XY coordinates.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    19 May 2016
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    character PREFIX, the common file prefix.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'dms_to_xy_test():\n' );
  fprintf ( 1, '  dms_to_xy() takes latitude and longitude\n' );
  fprintf ( 1, '  information, and assigns pseudo XY coordinates.\n' );

  main_filename = sprintf ( '%s_main.txt', prefix );
  dms_filename = sprintf ( '%s_dms.txt', prefix );
  point_xy_filename = sprintf ( '%s_xy.txt', prefix );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The main filename is "%s".\n', main_filename );
  fprintf ( 1, '  The dms filename is "%s"\n', dms_filename );
  fprintf ( 1, '  The point XY filename will be "%s".\n', point_xy_filename );

  n = main_read_size ( main_filename );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The number of data items is %d\n', n );

  [ lat_dms, lon_dms ] = dms_read ( dms_filename, n );

  dms_print ( n, lat_dms, lon_dms, '  The longitude/latidude data:' );

  point_xy = dms_to_xy ( n, lat_dms, lon_dms );

  r8mat_transpose_print ( 2, n, point_xy, '  The computed point values:' );

  r8mat_write ( point_xy_filename, 2, n, point_xy );

  return
end
