If the user enters A it works then they enter B it works and it works if they enter E it also works but if they then enter A to start over the program closes.
const double COMMRATE = 0.10;
const double COMMRATE = 0.10;
string inputstring;
char response;
Console.Write("Do you want to Calculate Sales A or B or E...");
inputstring = Console.ReadLine();
response = Convert.ToChar(inputstring);
while (response == 'A')
{
Console.WriteLine("Enter amount of sales");
string salesStr = Console.ReadLine();
Console.WriteLine(Double.Parse(salesStr) * COMMRATE);
Console.WriteLine("Enter sales member to continue or Z to exit");
response = Convert.ToChar(Console.ReadLine());
}
while (response == 'B')
{
Console.WriteLine("Enter amount of sales");
string salesStr = Console.ReadLine();
Console.WriteLine(Double.Parse(salesStr) * COMMRATE);
Console.WriteLine("Enter sales member to continue or Z to exit");
response = Convert.ToChar(Console.ReadLine());
}
while (response == 'E')
{
Console.WriteLine("Enter amount of sales");
string salesStr = Console.ReadLine();
Console.WriteLine(Double.Parse(salesStr) * COMMRATE);
Console.WriteLine("Enter sales member to continue or Z to exit");
response = Convert.ToChar(Console.ReadLine());
}