// Program miles prints miles in kilometers.

// Begin with preprocessor directives and using statements

#include <iostream>
using namespace std;

// Next we provide the function prototype (signature / header) for
// any functions other than main that are defined in this file

//   Note that we do not have to give a variable name for each formal
//   argument, just its type

float kilometers(int);

// Global variables are typically defined at this point.  There are none
// in this example.

// Define the global function main()

int main()
{
	// Invoke the kilometers() function with three different arguments
	// Note that these expressions are evaluated as the following statements
	// are executed from left to right.
	
	cout << "One mile is " << kilometers(1) << " kilometers." << endl;
	cout << "Ten miles is " << kilometers(10) << " kilometers." << endl;
	cout << "One hundred miles is " << kilometers(100) 
	     << " kilometers." << endl;
	
	return 0;
}

// Define the global function kilometers()

float kilometers(int miles)
{
	const float KILO = 1.609;
	float kilometers;
	
	kilometers = KILO * float(miles);
	
	return kilometers;
}

