Having a problem geting this to run!

heres the cod,e i now understand i cant have a being defined as multiple things

#include <iostream>
#include <cmath>

using namespace std;
int main()
{
int x;

cout << "Would you like to convert from 1) Imperial to Metirc\n 2)Metric to Imperial?\nEnter either 1 or 2:" ;
cin >> x;

if (x = 1)
{
int a = 1;
int a = 2;
int a = 3;
int a = 4;
int a = 5;
int a = 6;
int a = 7;
double var;

cout << "Enter the corresponding number from which unit you wish to convert from:"<<endl;
cout << "1 = fl Oz\n2 = gal\n3 = Oz\n4 = Lb(s)\n5 = in\n6 = ft\n7 = mi" <<endl;
cin >> a;
cout << "Enter amount of chosen unit:" <<endl;
cin >> var;


switch (a)
{
case 1:
double ml = (var*29.57);
double l = (var*0.02957);
cout << ""<<var<<" fl Oz is equal to "<<ml<<" ml";
cout << ""<<var<<" fl Oz is equal to "<<l<<" L";
break;
case 2:
double mml = (var*3785.41);
double ll = (var*3.785411);
cout << ""<<var<<" gal is equal to "<<mml<<" ml";
cout << ""<<var<<" gal is equal to "<<ll<<" L";
break;
case 3:
double g = (var*28.385);
double kg = (var*0.02835);
cout << ""<<var<<" oz is equal to "<<g<<" g";
cout << ""<<var<<" oz is eaual to "<<kg<<" kg";
break;
case 4:
double gg = (var*454.59);
double kkg = (var*0.4535);
cout << ""<<var<<" lb is equal to "<<g<<" g";
cout << ""<<var<<" lb is equal to "<<kkg<<" kg";
break;
case 5:
double mm = (var*25.4);
double cm = (var*2.54);
double m = (var*0.0254);
double km = (var*2.54E-5);
cout << ""<<var<<" in is equal to "<<mm<<" mm";
cout << ""<<var<<" in is equal to "<<cm<<" cm";
cout << ""<<var<<" in is equal to "<<m<<" m";
cout << ""<<var<<" in is equal to "<<km<<" km";
break;
case 6:
double mmm = (var*304.8);
double ccm = (var*30.48);
double me = (var*0.3048);
double kkm = (var*0.0003048);
cout << ""<<var<<" in is equal to "<<mmm<<" mm";
cout << ""<<var<<" in is equal to "<<ccm<<" cm";
cout << ""<<var<<" in is equal to "<<me<<" m";
cout << ""<<var<<" in is equal to "<<kkm<<" km";
break;
case 7:
double mili = (var*1609344);
double centi = (var*160934.4);
double met = (var*1609.344);
double kilo = (var*1.609);
cout << ""<<var<<" in is equal to "<<mili<<" mm";
cout << ""<<var<<" in is equal to "<<centi<<" cm";
cout << ""<<var<<" in is equal to "<<met<<" m";
cout << ""<<var<<" in is equal to "<<kilo<<" km";
break;
}
}
else if (x = 2)
{
int b = 1;
int b = 2;
int b = 3;
int b = 4;
int b = 5;
int b = 6;
int b = 7;
double num;

cout << "Enter the corresponding number from which unit you wish to convert from:"<<endl;
cout << "1 = ml\n2 = L\n3 = g\n4 = kg\n5 = mm\n6 = cm\n7 = m\n8 = km" <<endl;
cin >> b;
cout << "Enter amount of chosen unit:" <<endl;
cin >> num;


switch (b)
{
case 1:
double floz = (num*0.0033814);
double gal = (num*0.00026147);
cout << ""<<num<<" ml is equal to "<<floz<<" fl Oz";
cout << ""<<num<<" ml is equal to "<<gal<<" gal";
break;
case 2:
double ffloz = (num*33.814);
double ggal = (num*0.26417);
cout << ""<<num<<" L is equal to "<<ffloz<<" fl Oz";
cout << ""<<num<<" L is equal to "<<ggmal<<" gal";
break;
case 3:
double oz = (num*0.03527);
double lb = (num*0.002204);
cout << ""<<num<<" g is equal to "<<oz<<" oz";
cout << ""<<num<<" g is equal to "<<lb<<" lb";
break;
case 4:
double oz2 = (num*35.273);
double lb2 = (num*2.2046);
cout << ""<<num<<" kg is equal to "<<oz2<<" oz";
cout << ""<<num<<" kg is equal to "<<lb2<<" lb";
case 5:
double in = (num*0.03937);
double ft = (num*0.00328);
double mi = (num*6.213*10^-7);
cout << ""<<num<<" mm is equal to "<<in<<" in";
cout << ""<<num<<" mm is equal to "<<ft<<" ft";
cout << ""<<num<<" mm is equal to "<<mi<<" mi";
break;
case 6:
double in2 = (num*0.3937);
double ft2 = (num*0.0328);
double mi2 = (num*6.213*10^-6);
cout << ""<<num<<" cm is equal to "<<in2<<" in";
cout << ""<<num<<" cm is equal to "<<ft2<<" ft";
cout << ""<<num<<" cm is equal to "<<mi2<" mi";
break;
case 7:
double in3 = (num*39.37);
double ft3 = (num*3.2808);
double mi3 = (num*0.0006213);
cout << ""<<num<<" m is equal to "<<in3<<" in";
cout << ""<<num<<" m is equal to "<<ft3<<" ft";
cout << ""<<num<<" m is equal to "<<mi3<<" mi";
break;
case 8:
double in4 = (num*39370.07);
double ft4 = (num*3280.83);
double mi4 = (num*0.62137);
cout << ""<<num<<" km is equal to "<<in4<<" in";
cout << ""<<num<<" km is equal to "<<ft4<<" ft";
cout << ""<<num<<" km is equal to "<<mi4<<" mi";
}
}

else
{
cout << "Please enter either 1 or 2" <<endl;
}
system ("pause");
return 0;


}
And the question is...?
sorry, forgot to add that:

1. Write a unit conversion program that asks the users from which unit they want to convert (fl. Oz, gal, oz, lb, in, ft, mi) and to which unit they want to convert (ml, l, g, kg, mm, cm, m, km). [ 20 Marks ].
o Reject incompatible conversions (such as gal → km). ask for the value.
o Ask for the value to be converted, then display the results.
Topic archived. No new replies allowed.