i have problem my teacher failed to solve, there are no errors but when i debug the program i get exception saying:"when converting string todate time, parse the string to take the date before putting each variable into the DateTime object". In this line:"
//stopa poreza
double brutoPlaca = Convert.ToDouble(textBox3.Text);"
original code:
string stopaDoprinosa; double Doprinos = 0;
string stopaPoreza; double Porez = 0;
double netoPlaca;
//doprinos
if (textBox2.Text == "Osijek")
{ stopaDoprinosa = "13%"; }
else
{ stopaDoprinosa = "8%"; }
//stopa poreza
double brutoPlaca = Convert.ToDouble(textBox3.Text);
if (brutoPlaca <= 3000)
{ stopaPoreza = "10%"; }
else
{ stopaPoreza = "20%"; }
//porez
if (stopaPoreza == "10%")
{ Porez = 0.1; }
if (stopaPoreza == "20%")
{ Porez = 0.2; }
//neto plaća
netoPlaca = brutoPlaca * Porez;
if (stopaDoprinosa == "8%")
{ Doprinos = 0.08; }
if (stopaDoprinosa == "13%")
{ Doprinos = 0.13; }
Djelatnik d = new Djelatnik(textBox1.Text, textBox2.Text, brutoPlaca,stopaDoprinosa,Doprinos,stopaPoreza,Porez,netoPlaca);
Djelatnici.Add(d);