Prime b

Prime b

  • NA
  • 810
  • 345.8k

Check low

Dec 15 2011 3:33 PM
Here is what I was working on:

Create a GUI application that allows the user to enter
an hourly pay rate in a TextBox. When the user clicks
a button and the value in the TextBox is less than
$7.50, display an error message

This is my source code:

            double payrate;
            double actualyPayRate = 7.5;

            payrate = Convert.ToDouble(inputTextBox.Text);
            if (payrate < actualyPayRate)
                displayLabel.Text = "Illegal pay rate!";
            else
                displayLabel.Text = "Thank you!";

I am curious if there is another way to do the same work, any suggestions?

Answers (3)