Question: #include #include #include using namespace std; double ConvertWeight ( double value, char inUnits, char outUnits ) { const double PT _ TO _ L =
#include
#include
#include
using namespace std;
double ConvertWeightdouble value, char inUnits, char outUnits
const double PTTOL ;
const double QTTOL ;
const double GALTOL ;
if inUnits P && outUnits L
return value PTTOL;
else if inUnits Q && outUnits L
return value QTTOL;
else if inUnits G && outUnits L
return value GALTOL;
else
cerr "Invalid input or output units." endl;
return ; Error value
int main
ifstream inputFiledatatxt;
if inputFile.isopen
cerr "Unable to open the file." endl;
return ;
double value;
char inUnits, outUnits;
while inputFile value inUnits outUnits
double result ConvertWeightvalue inUnits, outUnits;
if result
cout fixed setprecision;
cout value inUnits is equal to result outUnits endl;
inputFile.close;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
