// A program to compute the number of liters for gallons and quarts
// Version 4:  table of liters for quarts and gallons

#include <iostream.h>

int main (void)
{  const double conversion_factor = 1.056710;
   int gals, quarts;
   double liters;
   cout << "Table of liter equivalents for gallons and quarts" << endl << endl; 
   cout << "                           Quarts" << endl;
   cout << "Gallons          0           1           2           3" << endl;
   cout.setf(ios::fixed);   

   cout.precision(4);
   for (gals = 0; gals <= 5; gals++)
     { cout.width(4);
       cout << gals << "     ";
       for (quarts = 0; quarts <= 3; quarts++)
         { liters  = (4.0*gals + quarts) / conversion_factor ;
           cout.width(12) ; 
           cout << liters ;
         }
     cout << endl;
      }

   return 0;
}
