stiffening
stiffening
CC#
Created by stiffening on 4/18/2024 in #help
my scores array program isn't functioning (i'm a total novice)
hi, i hope i'm posting in the right place. i'm trying to make a little program that takes several scores a user puts in, stores them in an array, then tells the user their total and averages, along with how many scores that's been counted (up to a max of 10.) it has a second function of bringing up a new window to display all the scores that have been submitted. when i test it it is not working. i can input a value in the score text box, but it doesn't display the calculations or bring up the new window. even the exit button isn't working and i don't know why. i'm using visual studio and c#. if anyone could look this over and tell me what's wrong i'd really appreciate it! i'd posted this in code-review, but that was the wrong channel https://pastebin.com/byz50XRe
10 replies
CC#
Created by stiffening on 3/3/2024 in #help
✅ "debug executable 'location' specified in the [project] debug profile does not exist"
hello, i'm an absolute beginner with c# and am trying to work on a project for school. whenever i rebuild and try to run without debugging, visual studio gives me the error message "debug executable 'location' specified in the [project] debug profile does not exist." (location is the folder, and project is project name; i didn't list them because my professor requires it to have my full name in it and i'd prefer not to post that info online.) this happens when i add some coding. when i remove the coding, it does open the project. i don't know what i'm doing wrong to cause this. the project is supposed to be income tax calculator. the following is the coding i've been trying to use that causes the errors:
private void btnCalculate_Click(object sender, EventArgs e)
{
decimal TaxableIncome = Convert.ToDecimal(txtTaxableIncome.Text);
decimal TaxOwed = Convert.ToDecimal(txtTaxOwed.Text);

if (TaxableIncome <= 0m)
TaxOwed = .0m;

else if (TaxableIncome >= 0m && TaxableIncome <= 11000m)
TaxOwed = 0m + .10m;

else if (TaxableIncome > 11000m && TaxableIncome <= 44725)
TaxOwed = 1100m + (TaxableIncome * .12);

else if (TaxableIncome > 44725 && TaxableIncome <= 95375)
TaxOwed = 5147m + (TaxableIncome * .22);

else if (TaxableIncome > 95375 && TaxableIncome <= 182100)
TaxOwed = 16290m + (TaxableIncome * .24);

else if (TaxableIncome > 182100 && TaxableIncome <= 231250)
TaxOwed = 37104m + (TaxableIncome * .32);

else if (TaxableIncome > 231250 && TaxableIncome <= 578125)
TaxOwed = 52832m + (TaxableIncome * .35);

else if (TaxableIncome < 578125)
TaxOwed = 174238.25 + (TaxableIncome * .37);
}
private void btnCalculate_Click(object sender, EventArgs e)
{
decimal TaxableIncome = Convert.ToDecimal(txtTaxableIncome.Text);
decimal TaxOwed = Convert.ToDecimal(txtTaxOwed.Text);

if (TaxableIncome <= 0m)
TaxOwed = .0m;

else if (TaxableIncome >= 0m && TaxableIncome <= 11000m)
TaxOwed = 0m + .10m;

else if (TaxableIncome > 11000m && TaxableIncome <= 44725)
TaxOwed = 1100m + (TaxableIncome * .12);

else if (TaxableIncome > 44725 && TaxableIncome <= 95375)
TaxOwed = 5147m + (TaxableIncome * .22);

else if (TaxableIncome > 95375 && TaxableIncome <= 182100)
TaxOwed = 16290m + (TaxableIncome * .24);

else if (TaxableIncome > 182100 && TaxableIncome <= 231250)
TaxOwed = 37104m + (TaxableIncome * .32);

else if (TaxableIncome > 231250 && TaxableIncome <= 578125)
TaxOwed = 52832m + (TaxableIncome * .35);

else if (TaxableIncome < 578125)
TaxOwed = 174238.25 + (TaxableIncome * .37);
}
any and all advice appreciated, thanks so much!
32 replies