Metric Conversion


//////////////////////////////////
//
// Author : Wyatt Date : 1/1/2000
// File: Metric.cpp
// Purpose: Convert fabric measure in sq meters to sq yds
// Algorithm:
//         Ask user for meters in meters
//         Store value
//         Convert sq meters to sq yards
//         Display converted info
//
#include <iostream>
using namespace std;

int main ()
{
   // Local data ...
   const float meters_to_yards = 1.196; // conversion constant
   float size_in_sqmeters;
   float size_in_sqyards;

   // Get size
   cout << "Enter the fabric size in square meters: ";
   cin  >> size_in_sqmeters;

   // Convert the size
   size_in_sqyards = meters_to_yards * size_in_sqmeters;

   // Display size
   cout << "The fabric size in square yards is "
        << size_in_sqyards << endl;
        
   return 0;
}