-
February 1st, 2014, 11:06 PM
#1
Novice, Need some help.
I am creating a simple overtime calculator with if then statements. I am missing something and I am sure it is simple. Here is the code snippet.
string str_hours = txtHours.Text;
double hours = Convert.ToDouble(str_hours);
string str_payrate = txtPayRate.Text;
double payrate = Convert.ToDouble(str_payrate);
string str_paycheck = txtPaycheck.Text;
double paycheck = Convert.ToDouble(str_paycheck);
if (hours <= 40)
paycheck=hours * 40;
else
paycheck=40 * payrate + (hours - 40) * 1.5;
txtPaycheck.Text = str_paycheck;
-
February 2nd, 2014, 08:10 PM
#2
Re: Novice, Need some help.
-
February 3rd, 2014, 12:30 AM
#3
Re: Novice, Need some help.
You're using str_paycheck
and then something different
Post the exact problem, though
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|