1. ## Help x.x

This code makes it multiply by .65 every time. Can someone explain to me why it's doing this?

Code:
```        private void button1_Click(object sender, EventArgs e)
{
double NumberOfPieces;
double EarnedPay = 0;

NumberOfPieces = Double.Parse(PiecesTextBox.Text);

if (NumberOfPieces > 0 && NumberOfPieces <= 199 )
{
EarnedPay = NumberOfPieces * .50;
}
if (NumberOfPieces >= 200 && NumberOfPieces <= 399)
{
EarnedPay = NumberOfPieces * .55;
}
if (NumberOfPieces >= 400 && NumberOfPieces <= 599)
{
EarnedPay = NumberOfPieces * .60;
}
if (NumberOfPieces <= 600)
{
EarnedPay = NumberOfPieces * .65;
}

EarnedTextBox.Text = EarnedPay.ToString("C");```

2. (NumberOfPieces <= 600)
everything is less than 600 before it, maybe you meant to put >= ?

3. That was it! Thank you very much! .

4. This is how I took care of the crash and burn of my program if they entered a letter where a numeric value would go but I don't know how to set one up for the NameTextBox.

What would the code be for making them type only letters into a text box and give them an error if they put numbers?

Code:
```            try
{
NumberOfPieces = int.Parse(PiecesTextBox.Text);
}
catch (FormatException) { MessageBox.Show("Please enter a Numeric Value"); }```

5. A better way might be to use int.TryParse(). Try this:
Code:
```            string text;
int num;

do
{
Console.Write("Enter some text (no numbers): ");
} while (text.Any(c => Char.IsDigit(c)));

do
{
Console.Write("Enter a number: ");

Console.WriteLine("The text you entered was: {0}", text);
Console.WriteLine("The number you entered was: {0}", num);```
If you don't like lambdas or LINQ (you'd have to be crazy not to!) you can always make a ContainsDigit() method that looks like:
Code:
```        private static bool ContainsDigit(string str)
{
foreach (char c in str)
if (Char.IsDigit(c))
return true;
return false;
}```
And then you just change the do/while loop to: while(ContainsDigit(text));

6. My program isn't a console though man. Its a form. I think i can use this though =). Thank you :P.