How do I fix this? I don't know how to convert inputted choice to equal the If statement.
Code:
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
int _tmain()
{
double cont = 1, r, theta, x, y, A, B;
__wchar_t choice;
while (cont == 1)
{
Console::Write( S"A Convert Polar Coordinates to Cartesian \n");
Console::Write( S"B Convert Cartesian Coordinates to Polar \n");
Console::Write( S"C Determine Roots of a quadratic equation \n");
choice = Char::Parse(Console::ReadLine());
if ( choice == A)
{
Console::Write( S"R: ");
r = Int32::Parse( Console::ReadLine());
Console::WriteLine( S"Theta: ");
theta = Int32::Parse( Console::ReadLine() );
x = r * Math::Cos(theta);
y = r * Math::Sin(theta);
Console::Write( S"X: {0}", x.ToString());
Console::Write( S"Y: {0}", y.ToString());
return 0;
}
if ( choice == B)
{
Console::WriteLine( S"X: ");
x = Int32::Parse( Console::ReadLine() );
Console::WriteLine( S"Y: ");
y = Int32::Parse( Console::ReadLine() );
r = Math::Sqrt(Math::Pow(x, 2)+Math::Pow(y, 2));
theta = Math::Atan(y/x);
return 0;
}
}
}