### Relativistic Effects Calculator, Almost working

So I recently took on the task of making a 'Relativity Calculator' and am Having a trouble with some if statements. I am fairly new to programming, so forgive me if it's obvious. Here is the code.
 ``1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677`` ``````// This program is designed to tell a user the Relitivistic Length, mass and time //of something going a certain speed under c #include #include #include using namespace std; int main() { char choice; // User's choice float c; //Speed of light c = 299792458; cout << "Welcome to Craig McRae's Relitivity Calculator!" << endl; cout << "What would you like to calculate?" << endl; cout << "A) Relitivistic Length, Mass and Time dilation" << endl; cout << "B) Relitivistic Velocity addition" << endl; cin >> choice; if ( choice == A ) // here it says A is not defined { float V; //Speed float length, mass, time; //Initial mass, length, and time float Rlength, Rmass, Rtime; //Relitivistic Length, mass and time float y; //Gamma or Lorentz transform cout << "How fast are you going? (m/s)"; cin >> V; while ( V >= c ) {cout << "IMPOSSIBLE! NOTHING CAN GO THAT FAST!" << endl; cout << "How fast are you REALLY going? (m/s)"; cin >> V; } cout << "How long were you traveling at this speed? (in seconds) "; cin >> time; cout << "Enter your mass in kg: "; cin >> mass; cout << "Enter your length in meters: "; cin >> length; y = sqrt(1 - ((V*V)/(c*c))); Rmass = mass / y; Rtime = time / y; Rlength = length * y; cout << "Traveling at a speed of " << V << "m/s, to an observer at rest you would appear to have a length of " << Rlength << " meters, a mass of " << Rmass << " kg, and " << time << " seconds for you would be " << Rtime << " seconds for the observer!" << endl; } if ( choice == B ) // here it says B is not defined { float V1, V2, Vf; //Velocities char ans; cout << "What is the first velocity?"; cin >> V1; cout << "What is the second Velocity?"; cin >> V2; cout << "Are they going in the same direction? (Y/N)"; cin >> ans; if ( ans == Y) // here it says Y is not defined V2 = -1 * V2; //Calculations Vf = abs(V1 + V2); V2 = -1 * V2; Vf = Vf/(1 + (V1*V2)/(c*c)); cout << " " << endl; cout << Vf << endl; //I incomplete final cout statement for testing } return 0; }``````

My problem is that it says A, B, and Y are not defined, and theyre not, I have them set up so the user inputs them. But when I do put them in as char, The program compiles, but does nothing after i input A or B. Any help is appreciated!
 `The program compiles, but does nothing after i input A or B.`

Have you tried making your input upper case?
No that did not work either, but I fixed the problem by assigning them all numerical values, Thanks
Topic archived. No new replies allowed.