4
Answers

Yet another problem with LOOPS

Prime b

Prime b

12y
2.5k
1
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)