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
345.3k
Help with loop
Jan 3 2012 1:59 PM
This is the problem
Write a console-based application that prompts a user for an
hourly pay rate. While the user enters values less than $5.65
or greater than $49.99, continue to prompt the user. Before
the program ends, display the valid pay rate
My question : Why do i keep getting infinite loop? How can i just make it show the hourly pay rate user entered?
Thats what I have done so far
double minPayRate = 5.65;
double maxPayRate = 49.99;
string inputString;
double userInput;
Console.WriteLine("Please enter your hourly pay rate");
inputString = Console.ReadLine();
userInput = Convert.ToDouble(inputString);
while (userInput != minPayRate && userInput != maxPayRate)
{
Console.WriteLine("{0}", userInput);
}
Console.WriteLine("Wrong hourly pay rate sorry");
Reply
Answers (
2
)
Get list of all the controls in my usercontrol
Using Repeater and Capturing Items Information