TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
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);
Reply
Answers (
4
)
Using Repeater and Capturing Items Information
Problem in update