Have no idea what to do

This is a homework assignment and I am almost done but I get one syntax error, here is my code:
 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120`` ``````#include #include #include #include #include using namespace std; int main() { enum Planet {MERCURY, VENUS, EARTH, MOON, MARS, JUPITER, SATURN, URANUS, NEPTUNE, PLUTO}; string planet; string badData = "**Invalid Planet**\n"; Planet inPlanet; double weight; double factor; // Output Variable double newWeight; do { cout << "Please enter a planet: "; cin >>planet; switch(toupper(planet[0])) { case 'M' : if(toupper(planet[1]) == 'E') { inPlanet = MERCURY; planet = "MERCURY"; // will correct any spelling mistakes so long as the first two letters are ME } else if(toupper(planet[1]) == 'A') { inPlanet = MARS; planet = "MARS"; // will correct any spelling mistakes so long as the first two letters are MA } else if(toupper(planet[1]) == 'O') { inPlanet = MOON; planet = "MOON"; // etc... you get the idea } else { cout <> weight; while (weight) if(inPlanet == MERCURY) factor = 0.4155; else if(inPlanet == VENUS) factor = 0.8975; else if(inPlanet == EARTH) factor = 1.0; else if(inPlanet == MOON) factor = 0.166; else if(inPlanet == MARS) factor = 0.3507; else if(inPlanet == JUPITER) factor = 2.5374; else if(inPlanet == SATURN) factor = 1.0677; else if(inPlanet == URANUS) factor = 0.8947; else if(inPlanet == NEPTUNE) factor = 1.1794; else if(inPlanet == PLUTO) factor = 0.0899; } // Output the results newWeight = factor * wieght; cout << "You selected " << planet << " as your planet. " << endl; cout << "You entered " << weight << " as your weight. " << endl; cout << fixed << setprecision(2) << "Your weight on " << planet << " is " << newWeight << "lbs" << endl; cin.get(); cin.get(); return 0; }``````

And here is my error:
error C2061: syntax error : identifier 'newWeight'

I have gone back to assignments like this one and I never got that error, could someone please point me in the right direction, thanks
am I missing something or have you missed something, what type is newWieght?

int, double?
Don't try to call `main();` from within main().

Use the normal control structures such as the while loop, or an if statement to achieve the processing you want.
Topic archived. No new replies allowed.