// unitConvert.cc   Sample program to convert inches to centimeters
// I. Aydin 11/16/2007  (note: substitute your own name and date)
//

//
// the following two lines allow stream input and output
//
#include <iostream.h>
using namespace std;

//
// ****** declaring function prototypes *********
//
double in2cm(double numInches);

// 
// ************ main program  ************
//
int main(){

   // define your variables for the main function here
   double inches;
   double cms;
   
   // prompt to user for input
   cout << "Please enter number of inches: ";   
   
   // read the user input into the variable inches
   cin  >> inches;
   
   // call the in2cm function to convert inches to cms
   cms = in2cm(inches);

   // print the result to the screen
   cout << "The answer in cm is: " << cms << endl; 

   
   // this is return for the main function  
   return 0;
}


// ************ user defined functions  ************

// 
// This function converts inches to centimeters
// 
double in2cm(double numInches){

   // declare the variables for the function in2cm
   double cmPerInch = 2.54;
   double result;

   // calculate the result
   result = cmPerInch * numInches;
   
   // return the result
   return result;
}
