### pls help

i keep getting the error message of the units not initialize and im have trouble reversing to conversion can anyone help me

// this program can convert between Metric and English system.
#include <iostream>
#include <cmath>

using namespace std;

int ShowList();

int main()
{
int choice =1;
double eng,celcius,centimeters,meters,kilometers,gram,kilogram, milliliter, liter, liters, squarecm;
double metric,fahrenheit,inches,feet,miles,ounce,pound,gallon,quart, PSI;

// If the user select 6, or with invalid entry, continue program otherwise.
int ShowList();
system("cls");
cout << "\n~~~~~~C O N V E R S I O N~~~~~~\n\n";
cout <<" 1 Distance\n";
cout <<" 2 Weight\n";
cout <<" 3 Volume\n";
cout <<" 4 Pressure\n";
cout <<" 5 Temperature\n";
cout <<" 6 End Program\n";
while ( !(cin >> choice) || choice <= 0 || choice > 6)
{
cout << "Invalid Entry";
cout << " Re-enter your selection";
fflush(stdin);
cin.get();
}

if (choice !=6)
switch (choice)
{
case 1:
cout << "\n You selected Distance.";
cout << "\n1. Inches to centimeters"<< endl;
cout << "2. feet to meters"<<endl;
cout << "3. miles to kilometer" << endl;
cout << "-----------------------------\n";
cout << "4. centimeters to inches" <<endl;
cout << "5. meters to feet"<<endl;
cout << "6. kilometers to miles"<<endl;
cout << "Enter your choice ";
cin >> choice;

if ( choice < 1 || choice > 6) //checks if the choice is correct
choice=false;
if ( choice )
{
cout << "\nEnter the quantity to convert: ";
cin >> eng;

metric = inches * 2.54;
metric = feet * 0.3048;
metric = miles * 1.609;//This is the actual conversion
cout << eng << " convert to " << metric << endl; //these lines output the conversion

cout << "\nEnter the quantity to convert: ";
cin >> metric;
eng = centimeters*0.39;
eng = meters*3.3;
eng = kilometers*.6;
cout << metric<< "convert to "<< eng <<endl;
}
else
cout << "Wrong input, the program will terminate" << endl;
fflush(stdin);
cin.get();
break;

case 2:
cout << "You selected Weight.";
cout << "\n1: ounce to gram"<<endl;
cout << "2: pound to kilogram"<<endl;
cout << "-----------------------\n";
cout << "3: gram to ounce"<<endl;
cout << "4: kilogram to pound\n"<<endl;
cin >> choice;

if ( choice < 1 || choice > 4) //checks if the choice is correct
choice=false;
if ( choice )
{
cout << "\nEnter the quantity to convert: ";
cin >> eng;

metric = ounce * 28.349, pound * 0.453; //This is the actual conversion
cout << eng << " convert to "<< metric << endl;//these lines output the conversions

cout << "\nEnter the quantity to convert: ";
cin >> metric;
eng = gram *0.04, kilogram * 2.2;
cout << metric << "convert to " << eng << endl;
}
else
cout << "Wrong input, the program will terminate" << endl;
fflush(stdin);
cin.get();
break;

case 3:
cout << "You selected voulme.";
cout << "\n1 0unce to millimeter"<<endl;
cout << "2 gallon to liter"<<endl;
cout << "3 quart to liters"<<endl;
cout << "---------------------------\n";
cout << "4 milliliter to ounce"<<endl;
cout << "5 liter to gallon"<<endl;
cout << "6 liters to quart\n"<<endl;
cout << "Enter your choice ";
cin >> choice;

if ( choice < 1 || choice > 6) //checks if the choice is correct
choice=false;
if ( choice )
{
cout << "\nEnter the quantity to convert: ";
cin >> eng;
cout << endl; //these lines "read" the user input
metric = ounce*29.573, gallon * 3.785,quart*0.946;
cout << eng << " convert to" << metric << endl; //these lines output the conversions

cout << "\nEnter the quantity to convert: ";
cin >> metric;
eng = milliliter *0.0338, liter *0.227, liters *1.1;
cout << metric << "convert to" << eng << endl;
}
else
cout << "Wrong input, the program will terminate" << endl;
fflush(stdin);
cin.get();
break;

case 4:
cout << "You selected Pressure.";
cout << "\n1 PSI to kg/square cm\n"<<endl;
cout << "-------------------------\n";
cout << "2 kg/square cm to PSI\n"<<endl;
cin >> choice;

if (choice < 1 || choice > 2)
choice=false;
if (choice)
{
cout << "\nEnter the quantity to convert:";
cin >> eng;
metric = PSI*0.07;
cout << eng << " convert to" << metric << endl;

cout << "\nEnter the quantity to convert: ";
cin >> metric;
eng = squarecm *14.2;
cout << metric << "convert to" << eng <<endl;
}
else
cout << "Wrong input, the program will terminate" << endl;
fflush(stdin);
cin.get();
break;

case 5:
cout << "You selected Temperature.";
cout << "\n1. Fahrenheit to Celsius\n";
cout << "--------------------------\n";
cout << "2. Celcius to Fahrenheit\n";
cin >> choice;

if (choice < 1 ||choice > 2)
choice=false;
if (choice)
{
cout << "\nEnter the quantity to convert:";
cin >> eng;
celcius = fahrenheit - 32*(5.0/9.0);
cout << eng << " convert to "<< metric << endl;

cout << "\nEnter the quantity to convert: ";
cin >> metric;
fahrenheit = celcius * (9.0/5.0)+32;
cout << metric << " convert to" << eng <<endl;
}
else
{ cout << "Wrong input, the program will terminate" << endl;}
fflush(stdin);
cin.get();
break;
}
cout << "\nPress<Enter> to end Program";
fflush(stdin);
cin.get();
system("pause");
return choice;
Which line is causing the message?
i'm getting the message on every line that has a measurement unit for example 'inches' is uninitialized
Topic archived. No new replies allowed.