this program is supposed to determine/calculate the tax that a person has to pay based on his taxable income.
I did some c# coding using visual studio.I keep getting errors.anyone knows the right way to do it?
my codes:
private void calculateTaxBTN_Click(object sender, EventArgs e)
{
double taxableIncome;
taxableIncome = Convert.ToDouble(userValueTB);
double tax;
tax = 0;
if (taxableIncome <= 38000)
{
tax = 0.195 * 3800;
}
if (taxableIncome > 3800 && taxableIncome <= 60000)
{
tax = 0.195 * 3800 + 0.33 * 22000;
}
if (taxableIncome > 60000)
{
tax = 0.195 * 38000 + 0.33 * 22000 + 0.39 * taxableIncome - 60000;
}
double displayLabel;
displayLabel = Convert.ToDouble(displayLabel.Text);
What is wrong with my c# visual studio coding?
Started by reja, May 22 2010 10:51 PM
3 replies to this topic
#1
Posted 22 May 2010 - 10:51 PM
|
|
|
#2
Posted 23 May 2010 - 05:19 AM
There's never a closing brace for the method for starters.
Secondly, displayLabel is declared as a double. What you want to do, provided you have a label called displayLabel is something like this:
also, I'm not sure what userValueTB is at all.
Secondly, displayLabel is declared as a double. What you want to do, provided you have a label called displayLabel is something like this:
diplayLabel.Text = tax.toString();
also, I'm not sure what userValueTB is at all.
#3
Posted 27 May 2010 - 07:17 AM
userValueTb is the name given to the text box that i created in the GUI design....p.s thanks for helping
#4
Posted 28 May 2010 - 11:46 AM
Sure thing.


Sign In
Create Account


Back to top









