You did not say where you get the error? My guess is that something goes wrong here:
classworkFcs = Convert.ToDouble(txtFcs_classwork.Text);
iaFcs = Convert.ToDouble(txtFcs_ia.Text);
examsFcs = Convert.ToDouble(txtFcs_exams.Text);
There is nothing wrong with the code here, but the data. For e.g.: if you classwork_txt is blank or someother string which can not be converted to
double
, you will get the error message which you currently get.
Option is to make sure that you get the correct data.
You can also try to use
TryParse [
^]method.