Prime b

Prime b

  • NA
  • 810
  • 346k

Yet another problem with LOOPS

Jan 3 2012 5:29 PM
Problem:

Th ree salespeople work at Sunshine Hot Tubs—Andrea,
Brittany, and Eric. Write a console-based application that
prompts the user for a salesperson's initial ('A', 'B', or 'E').
While the user does not type 'Z', continue by prompting for
the amount of a sale the salesperson made. Calculate the
salesperson's commission as 10% of the sale amount, and add
the commission to a running total for that salesperson. After
the user types 'Z' for an initial, display each salesperson's total
commission earned

Question: it doesn't work, what should I do

What I have done so far:

            char A, B, E, Z;
            string userInputString, userInputAmountString;
            char userInput;
            double userInputAmount, tip =.10, comission, total;

            do
            {
                Console.WriteLine("Please enter initial of the salesperson");
                userInputString = Console.ReadLine();
                userInput = Convert.ToChar(userInputString);
                Console.WriteLine("Please enter the amount of a sale the saleperson made");
                userInputAmountString = Console.ReadLine();
                userInputAmount = Convert.ToDouble(userInputAmountString);

                comission = userInputAmount * tip;
                total = comission + userInputAmount;

               
               
            }
            while ( userInput == A || userInput == B || userInput == E );
            Console.WriteLine("The total saleperson made is {0}", total);




Answers (4)