unit fm_Calculate_result; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TfrmCalculate_result = class(TForm) Label1: TLabel; GroupBox1: TGroupBox; Label2: TLabel; lblQPA: TLabel; Label3: TLabel; lblQPA2: TLabel; Label4: TLabel; lblQPA3: TLabel; OKButton: TButton; lblMQPA: TLabel; lblRQPA: TLabel; lblMGrade: TLabel; lblRGrade: TLabel; lblMCredits: TLabel; lblRCredits: TLabel; procedure FormShow(Sender: TObject); private { Private declarations } function Math( grade : string): double; function ReverseMath( final : double) : string; public { Public declarations } end; var frmCalculate_result: TfrmCalculate_result; implementation {$R *.DFM} uses fm_Calculate_main, untVariables; var ACalc : TCalc; function TfrmCalculate_result.Math( grade : string): double; begin if (grade = 'A') or (grade = 'a') or (grade = 'A+') then result := 4.0 else if (grade = 'A-') or (grade = 'a-') then result := 3.667 else if (grade = 'B+') or (grade = 'b+') then result := 3.333 else if (grade = 'B') or (grade = 'b') then result := 3.0 else if (grade = 'B-') or (grade = 'b-') then result := 2.667 else if (grade = 'C+') or (grade = 'c+') then result := 2.333 else if (grade = 'C') or (grade = 'c') then result := 2.0 else if (grade = 'C-') or (grade = 'C-') then result := 1.667 else if (grade = 'D+') or (grade = 'd+') then result := 1.333 else if (grade = 'D') or (grade = 'd') then result := 1.0 else if (grade = 'D-') or (grade = 'd-') then result := 0.667 else result := 0.0; end; function TfrmCalculate_result.ReverseMath(final : double) : string; begin if (final = 4.0) then result := 'A' else if (final >= 3.6665) and (final < 4.0) then result := 'A-' else if (final >= 3.333) and (final < 3.6665) then result := 'B+' else if (final >= 3.0) and (final < 3.333) then result := 'B' else if (final > 2.6665) and (final < 3.0) then result := 'B-' else if (final >= 2.333) and (final < 2.6665) then result := 'C+' else if (final >= 2.0) and (final < 2.333) then result := 'C' else if (final >= 1.667) and (final < 2.0) then result := 'C-' else if (final >= 1.3325) and (final < 1.667) then result := 'D+' else if (final >= 1.0) and (final < 1.3325) then result := 'D' else if (final >= 0.667) and (final < 1.0) then result := 'D-' else result := 'F'; end; procedure TfrmCalculate_result.FormShow(Sender: TObject); var i, check : integer; final_QPA, major_final_QPA, total_pts, major_total_pts : double; begin check := 0; ACalc := TCalc.Create; if (frmCalculate.edtClass1.Text <> '') then ACalc.grades[1] := self.Math(frmCalculate.edtClass1.Text); if (frmCalculate.edtClass2.Text <> '') then ACalc.grades[2] := self.Math(frmCalculate.edtClass2.Text); if (frmCalculate.edtClass3.Text <> '') then ACalc.grades[3] := self.Math(frmCalculate.edtClass3.Text); if (frmCalculate.edtClass4.Text <> '') then ACalc.grades[4] := self.Math(frmCalculate.edtClass4.Text); if (frmCalculate.edtClass5.Text <> '') then ACalc.grades[5] := self.Math(frmCalculate.edtClass5.Text); if (frmCalculate.edtClass6.Text <> '') then ACalc.grades[6] := self.Math(frmCalculate.edtClass6.Text); if (frmCalculate.edtCredits1.Text <> '') then ACalc.credits[1] := StrToInt(frmCalculate.edtCredits1.Text); if (frmCalculate.edtCredits2.Text <> '') then ACalc.credits[2] := StrToInt(frmCalculate.edtCredits2.Text); if (frmCalculate.edtCredits3.Text <> '') then ACalc.credits[3] := StrToInt(frmCalculate.edtCredits3.Text); if (frmCalculate.edtCredits4.Text <> '') then ACalc.credits[4] := StrToInt(frmCalculate.edtCredits4.Text); if (frmCalculate.edtCredits5.Text <> '') then ACalc.credits[5] := StrToInt(frmCalculate.edtCredits5.Text); if (frmCalculate.edtCredits6.Text <> '') then ACalc.credits[6] := StrToInt(frmCalculate.edtCredits6.Text); if (frmCalculate.TabSheet2.TabVisible = True) then begin if (frmCalculate.edtClass7.Text <> '') then ACalc.grades[7] := self.Math(frmCalculate.edtClass7.Text); if (frmCalculate.edtClass8.Text <> '') then ACalc.grades[8] := self.Math(frmCalculate.edtClass8.Text); if (frmCalculate.edtClass9.Text <> '') then ACalc.grades[9] := self.Math(frmCalculate.edtClass9.Text); if (frmCalculate.edtClass10.Text <> '') then ACalc.grades[10] := self.Math(frmCalculate.edtClass10.Text); if (frmCalculate.edtClass11.Text <> '') then ACalc.grades[11] := self.Math(frmCalculate.edtClass11.Text); if (frmCalculate.edtClass12.Text <> '') then ACalc.grades[12] := self.Math(frmCalculate.edtClass12.Text); if (frmCalculate.edtCredits7.Text <> '') then ACalc.credits[7] := StrToInt(frmCalculate.edtCredits7.Text); if (frmCalculate.edtCredits8.Text <> '') then ACalc.credits[8] := StrToInt(frmCalculate.edtCredits8.Text); if (frmCalculate.edtCredits9.Text <> '') then ACalc.credits[9] := StrToInt(frmCalculate.edtCredits9.Text); if (frmCalculate.edtCredits10.Text <> '') then ACalc.credits[10] := StrToInt(frmCalculate.edtCredits10.Text); if (frmCalculate.edtCredits11.Text <> '') then ACalc.credits[11] := StrToInt(frmCalculate.edtCredits11.Text); if (frmCalculate.edtCredits12.Text <> '') then ACalc.credits[12] := StrToInt(frmCalculate.edtCredits12.Text); end; if (frmCalculate.TabSheet3.TabVisible = True) then begin if (frmCalculate.edtClass13.Text <> '') then ACalc.grades[13] := self.Math(frmCalculate.edtClass13.Text); if (frmCalculate.edtClass14.Text <> '') then ACalc.grades[14] := self.Math(frmCalculate.edtClass14.Text); if (frmCalculate.edtClass15.Text <> '') then ACalc.grades[15] := self.Math(frmCalculate.edtClass15.Text); if (frmCalculate.edtClass16.Text <> '') then ACalc.grades[16] := self.Math(frmCalculate.edtClass16.Text); if (frmCalculate.edtClass17.Text <> '') then ACalc.grades[17] := self.Math(frmCalculate.edtClass17.Text); if (frmCalculate.edtClass18.Text <> '') then ACalc.grades[18] := self.Math(frmCalculate.edtClass18.Text); if (frmCalculate.edtCredits13.Text <> '') then ACalc.credits[13] := StrToInt(frmCalculate.edtCredits13.Text); if (frmCalculate.edtCredits14.Text <> '') then ACalc.credits[14] := StrToInt(frmCalculate.edtCredits14.Text); if (frmCalculate.edtCredits15.Text <> '') then ACalc.credits[15] := StrToInt(frmCalculate.edtCredits15.Text); if (frmCalculate.edtCredits16.Text <> '') then ACalc.credits[16] := StrToInt(frmCalculate.edtCredits16.Text); if (frmCalculate.edtCredits17.Text <> '') then ACalc.credits[17] := StrToInt(frmCalculate.edtCredits17.Text); if (frmCalculate.edtCredits18.Text <> '') then ACalc.credits[18] := StrToInt(frmCalculate.edtCredits18.Text); end; if (frmCalculate.TabSheet4.TabVisible = True) then begin if (frmCalculate.edtClass19.Text <> '') then ACalc.grades[19] := self.Math(frmCalculate.edtClass19.Text); if (frmCalculate.edtClass20.Text <> '') then ACalc.grades[20] := self.Math(frmCalculate.edtClass20.Text); if (frmCalculate.edtClass21.Text <> '') then ACalc.grades[21] := self.Math(frmCalculate.edtClass21.Text); if (frmCalculate.edtClass22.Text <> '') then ACalc.grades[22] := self.Math(frmCalculate.edtClass22.Text); if (frmCalculate.edtClass23.Text <> '') then ACalc.grades[23] := self.Math(frmCalculate.edtClass23.Text); if (frmCalculate.edtClass24.Text <> '') then ACalc.grades[24] := self.Math(frmCalculate.edtClass24.Text); if (frmCalculate.edtCredits19.Text <> '') then ACalc.credits[19] := StrToInt(frmCalculate.edtCredits19.Text); if (frmCalculate.edtCredits20.Text <> '') then ACalc.credits[20] := StrToInt(frmCalculate.edtCredits20.Text); if (frmCalculate.edtCredits21.Text <> '') then ACalc.credits[21] := StrToInt(frmCalculate.edtCredits21.Text); if (frmCalculate.edtCredits22.Text <> '') then ACalc.credits[22] := StrToInt(frmCalculate.edtCredits22.Text); if (frmCalculate.edtCredits23.Text <> '') then ACalc.credits[23] := StrToInt(frmCalculate.edtCredits23.Text); if (frmCalculate.edtCredits24.Text <> '') then ACalc.credits[24] := StrToInt(frmCalculate.edtCredits24.Text); end; if (frmCalculate.TabSheet5.TabVisible = True) then begin if (frmCalculate.edtClass25.Text <> '') then ACalc.grades[25] := self.Math(frmCalculate.edtClass25.Text); if (frmCalculate.edtClass26.Text <> '') then ACalc.grades[26] := self.Math(frmCalculate.edtClass26.Text); if (frmCalculate.edtClass27.Text <> '') then ACalc.grades[27] := self.Math(frmCalculate.edtClass27.Text); if (frmCalculate.edtClass28.Text <> '') then ACalc.grades[28] := self.Math(frmCalculate.edtClass28.Text); if (frmCalculate.edtClass29.Text <> '') then ACalc.grades[29] := self.Math(frmCalculate.edtClass29.Text); if (frmCalculate.edtClass30.Text <> '') then ACalc.grades[30] := self.Math(frmCalculate.edtClass30.Text); if (frmCalculate.edtCredits25.Text <> '') then ACalc.credits[25] := StrToInt(frmCalculate.edtCredits25.Text); if (frmCalculate.edtCredits26.Text <> '') then ACalc.credits[26] := StrToInt(frmCalculate.edtCredits26.Text); if (frmCalculate.edtCredits27.Text <> '') then ACalc.credits[27] := StrToInt(frmCalculate.edtCredits27.Text); if (frmCalculate.edtCredits28.Text <> '') then ACalc.credits[28] := StrToInt(frmCalculate.edtCredits28.Text); if (frmCalculate.edtCredits29.Text <> '') then ACalc.credits[29] := StrToInt(frmCalculate.edtCredits29.Text); if (frmCalculate.edtCredits30.Text <> '') then ACalc.credits[30] := StrToInt(frmCalculate.edtCredits30.Text); end; if (frmCalculate.TabSheet6.TabVisible = True) then begin if (frmCalculate.edtClass31.Text <> '') then ACalc.grades[31] := self.Math(frmCalculate.edtClass31.Text); if (frmCalculate.edtClass32.Text <> '') then ACalc.grades[32] := self.Math(frmCalculate.edtClass32.Text); if (frmCalculate.edtClass33.Text <> '') then ACalc.grades[33] := self.Math(frmCalculate.edtClass33.Text); if (frmCalculate.edtClass34.Text <> '') then ACalc.grades[34] := self.Math(frmCalculate.edtClass34.Text); if (frmCalculate.edtClass35.Text <> '') then ACalc.grades[35] := self.Math(frmCalculate.edtClass35.Text); if (frmCalculate.edtClass36.Text <> '') then ACalc.grades[36] := self.Math(frmCalculate.edtClass36.Text); if (frmCalculate.edtCredits31.Text <> '') then ACalc.credits[31] := StrToInt(frmCalculate.edtCredits31.Text); if (frmCalculate.edtCredits32.Text <> '') then ACalc.credits[32] := StrToInt(frmCalculate.edtCredits32.Text); if (frmCalculate.edtCredits33.Text <> '') then ACalc.credits[33] := StrToInt(frmCalculate.edtCredits33.Text); if (frmCalculate.edtCredits34.Text <> '') then ACalc.credits[34] := StrToInt(frmCalculate.edtCredits34.Text); if (frmCalculate.edtCredits35.Text <> '') then ACalc.credits[35] := StrToInt(frmCalculate.edtCredits35.Text); if (frmCalculate.edtCredits36.Text <> '') then ACalc.credits[36] := StrToInt(frmCalculate.edtCredits36.Text); end; if (frmCalculate.TabSheet7.TabVisible = True) then begin if (frmCalculate.edtClass37.Text <> '') then ACalc.grades[37] := self.Math(frmCalculate.edtClass37.Text); if (frmCalculate.edtClass38.Text <> '') then ACalc.grades[38] := self.Math(frmCalculate.edtClass38.Text); if (frmCalculate.edtClass39.Text <> '') then ACalc.grades[39] := self.Math(frmCalculate.edtClass39.Text); if (frmCalculate.edtClass40.Text <> '') then ACalc.grades[40] := self.Math(frmCalculate.edtClass40.Text); if (frmCalculate.edtClass41.Text <> '') then ACalc.grades[41] := self.Math(frmCalculate.edtClass41.Text); if (frmCalculate.edtClass42.Text <> '') then ACalc.grades[42] := self.Math(frmCalculate.edtClass42.Text); if (frmCalculate.edtCredits37.Text <> '') then ACalc.credits[37] := StrToInt(frmCalculate.edtCredits37.Text); if (frmCalculate.edtCredits38.Text <> '') then ACalc.credits[38] := StrToInt(frmCalculate.edtCredits38.Text); if (frmCalculate.edtCredits39.Text <> '') then ACalc.credits[39] := StrToInt(frmCalculate.edtCredits39.Text); if (frmCalculate.edtCredits40.Text <> '') then ACalc.credits[40] := StrToInt(frmCalculate.edtCredits40.Text); if (frmCalculate.edtCredits41.Text <> '') then ACalc.credits[41] := StrToInt(frmCalculate.edtCredits41.Text); if (frmCalculate.edtCredits42.Text <> '') then ACalc.credits[42] := StrToInt(frmCalculate.edtCredits42.Text); end; if (frmCalculate.TabSheet8.TabVisible = True) then begin if (frmCalculate.edtClass43.Text <> '') then ACalc.grades[43] := self.Math(frmCalculate.edtClass43.Text); if (frmCalculate.edtClass44.Text <> '') then ACalc.grades[44] := self.Math(frmCalculate.edtClass44.Text); if (frmCalculate.edtClass45.Text <> '') then ACalc.grades[45] := self.Math(frmCalculate.edtClass45.Text); if (frmCalculate.edtClass46.Text <> '') then ACalc.grades[46] := self.Math(frmCalculate.edtClass46.Text); if (frmCalculate.edtClass47.Text <> '') then ACalc.grades[47] := self.Math(frmCalculate.edtClass47.Text); if (frmCalculate.edtClass48.Text <> '') then ACalc.grades[48] := self.Math(frmCalculate.edtClass48.Text); if (frmCalculate.edtCredits43.Text <> '') then ACalc.credits[43] := StrToInt(frmCalculate.edtCredits43.Text); if (frmCalculate.edtCredits44.Text <> '') then ACalc.credits[44] := StrToInt(frmCalculate.edtCredits44.Text); if (frmCalculate.edtCredits45.Text <> '') then ACalc.credits[45] := StrToInt(frmCalculate.edtCredits45.Text); if (frmCalculate.edtCredits46.Text <> '') then ACalc.credits[46] := StrToInt(frmCalculate.edtCredits46.Text); if (frmCalculate.edtCredits47.Text <> '') then ACalc.credits[47] := StrToInt(frmCalculate.edtCredits47.Text); if (frmCalculate.edtCredits48.Text <> '') then ACalc.credits[48] := StrToInt(frmCalculate.edtCredits48.Text); end; if (frmCalculate.CheckBox1.Checked = True) then begin ACalc.major_grades[1] := ACalc.grades[1]; ACalc.major_credits[1] := ACalc.credits[1]; check := 1; end; if (frmCalculate.CheckBox2.Checked = True) then begin ACalc.major_grades[2] := ACalc.grades[2]; ACalc.major_credits[2] := ACalc.credits[2]; check := 1; end; if (frmCalculate.CheckBox3.Checked = True) then begin ACalc.major_grades[3] := ACalc.grades[3]; ACalc.major_credits[3] := ACalc.credits[3]; check := 1; end; if (frmCalculate.CheckBox4.Checked = True) then begin ACalc.major_grades[4] := ACalc.grades[4]; ACalc.major_credits[4] := ACalc.credits[4]; check := 1; end; if (frmCalculate.CheckBox5.Checked = True) then begin ACalc.major_grades[5] := ACalc.grades[5]; ACalc.major_credits[5] := ACalc.credits[5]; check := 1; end; if (frmCalculate.CheckBox6.Checked = True) then begin ACalc.major_grades[6] := ACalc.grades[6]; ACalc.major_credits[6] := ACalc.credits[6]; check := 1; end; if (frmCalculate.TabSheet2.TabVisible = True) then begin if (frmCalculate.CheckBox7.Checked = True) then begin ACalc.major_grades[7] := ACalc.grades[7]; ACalc.major_credits[7] := ACalc.credits[7]; check := 1; end; if (frmCalculate.CheckBox8.Checked = True) then begin ACalc.major_grades[8] := ACalc.grades[8]; ACalc.major_credits[8] := ACalc.credits[8]; check := 1; end; if (frmCalculate.CheckBox9.Checked = True) then begin ACalc.major_grades[9] := ACalc.grades[9]; ACalc.major_credits[9] := ACalc.credits[9]; check := 1; end; if (frmCalculate.CheckBox10.Checked = True) then begin ACalc.major_grades[10] := ACalc.grades[10]; ACalc.major_credits[10] := ACalc.credits[10]; check := 1; end; if (frmCalculate.CheckBox11.Checked = True) then begin ACalc.major_grades[11] := ACalc.grades[11]; ACalc.major_credits[11] := ACalc.credits[11]; check := 1; end; if (frmCalculate.CheckBox12.Checked = True) then begin ACalc.major_grades[12] := ACalc.grades[12]; ACalc.major_credits[12] := ACalc.credits[12]; check := 1; end; end; if (frmCalculate.TabSheet3.TabVisible = True) then begin if (frmCalculate.CheckBox13.Checked = True) then begin ACalc.major_grades[13] := ACalc.grades[13]; ACalc.major_credits[13] := ACalc.credits[13]; check := 1; end; if (frmCalculate.CheckBox14.Checked = True) then begin ACalc.major_grades[14] := ACalc.grades[14]; ACalc.major_credits[14] := ACalc.credits[14]; check := 1; end; if (frmCalculate.CheckBox15.Checked = True) then begin ACalc.major_grades[15] := ACalc.grades[15]; ACalc.major_credits[15] := ACalc.credits[15]; check := 1; end; if (frmCalculate.CheckBox16.Checked = True) then begin ACalc.major_grades[16] := ACalc.grades[16]; ACalc.major_credits[16] := ACalc.credits[16]; check := 1; end; if (frmCalculate.CheckBox17.Checked = True) then begin ACalc.major_grades[17] := ACalc.grades[17]; ACalc.major_credits[17] := ACalc.credits[17]; check := 1; end; if (frmCalculate.CheckBox18.Checked = True) then begin ACalc.major_grades[18] := ACalc.grades[18]; ACalc.major_credits[18] := ACalc.credits[18]; check := 1; end; end; if (frmCalculate.TabSheet4.TabVisible = True) then begin if (frmCalculate.CheckBox19.Checked = True) then begin ACalc.major_grades[19] := ACalc.grades[19]; ACalc.major_credits[19] := ACalc.credits[19]; check := 1; end; if (frmCalculate.CheckBox20.Checked = True) then begin ACalc.major_grades[20] := ACalc.grades[20]; ACalc.major_credits[20] := ACalc.credits[20]; check := 1; end; if (frmCalculate.CheckBox21.Checked = True) then begin ACalc.major_grades[21] := ACalc.grades[21]; ACalc.major_credits[21] := ACalc.credits[21]; check := 1; end; if (frmCalculate.CheckBox22.Checked = True) then begin ACalc.major_grades[22] := ACalc.grades[22]; ACalc.major_credits[22] := ACalc.credits[22]; check := 1; end; if (frmCalculate.CheckBox23.Checked = True) then begin ACalc.major_grades[23] := ACalc.grades[23]; ACalc.major_credits[23] := ACalc.credits[23]; check := 1; end; if (frmCalculate.CheckBox24.Checked = True) then begin ACalc.major_grades[24] := ACalc.grades[24]; ACalc.major_credits[24] := ACalc.credits[24]; check := 1; end; end; if (frmCalculate.TabSheet5.TabVisible = True) then begin if (frmCalculate.CheckBox25.Checked = True) then begin ACalc.major_grades[25] := ACalc.grades[25]; ACalc.major_credits[25] := ACalc.credits[25]; check := 1; end; if (frmCalculate.CheckBox26.Checked = True) then begin ACalc.major_grades[26] := ACalc.grades[26]; ACalc.major_credits[26] := ACalc.credits[26]; check := 1; end; if (frmCalculate.CheckBox27.Checked = True) then begin ACalc.major_grades[27] := ACalc.grades[27]; ACalc.major_credits[27] := ACalc.credits[27]; check := 1; end; if (frmCalculate.CheckBox28.Checked = True) then begin ACalc.major_grades[28] := ACalc.grades[28]; ACalc.major_credits[28] := ACalc.credits[28]; check := 1; end; if (frmCalculate.CheckBox29.Checked = True) then begin ACalc.major_grades[29] := ACalc.grades[29]; ACalc.major_credits[29] := ACalc.credits[29]; check := 1; end; if (frmCalculate.CheckBox30.Checked = True) then begin ACalc.major_grades[30] := ACalc.grades[30]; ACalc.major_credits[30] := ACalc.credits[30]; check := 1; end; end; if (frmCalculate.TabSheet6.TabVisible = True) then begin if (frmCalculate.CheckBox31.Checked = True) then begin ACalc.major_grades[31] := ACalc.grades[31]; ACalc.major_credits[31] := ACalc.credits[31]; check := 1; end; if (frmCalculate.CheckBox32.Checked = True) then begin ACalc.major_grades[32] := ACalc.grades[32]; ACalc.major_credits[32] := ACalc.credits[32]; check := 1; end; if (frmCalculate.CheckBox33.Checked = True) then begin ACalc.major_grades[33] := ACalc.grades[33]; ACalc.major_credits[33] := ACalc.credits[33]; check := 1; end; if (frmCalculate.CheckBox34.Checked = True) then begin ACalc.major_grades[34] := ACalc.grades[34]; ACalc.major_credits[34] := ACalc.credits[34]; check := 1; end; if (frmCalculate.CheckBox35.Checked = True) then begin ACalc.major_grades[35] := ACalc.grades[35]; ACalc.major_credits[35] := ACalc.credits[35]; check := 1; end; if (frmCalculate.CheckBox36.Checked = True) then begin ACalc.major_grades[36] := ACalc.grades[36]; ACalc.major_credits[36] := ACalc.credits[36]; check := 1; end; end; if (frmCalculate.TabSheet7.TabVisible = True) then begin if (frmCalculate.CheckBox37.Checked = True) then begin ACalc.major_grades[37] := ACalc.grades[37]; ACalc.major_credits[37] := ACalc.credits[37]; check := 1; end; if (frmCalculate.CheckBox38.Checked = True) then begin ACalc.major_grades[38] := ACalc.grades[38]; ACalc.major_credits[38] := ACalc.credits[38]; check := 1; end; if (frmCalculate.CheckBox39.Checked = True) then begin ACalc.major_grades[39] := ACalc.grades[39]; ACalc.major_credits[39] := ACalc.credits[39]; check := 1; end; if (frmCalculate.CheckBox40.Checked = True) then begin ACalc.major_grades[40] := ACalc.grades[40]; ACalc.major_credits[40] := ACalc.credits[40]; check := 1; end; if (frmCalculate.CheckBox41.Checked = True) then begin ACalc.major_grades[41] := ACalc.grades[41]; ACalc.major_credits[41] := ACalc.credits[41]; check := 1; end; if (frmCalculate.CheckBox42.Checked = True) then begin ACalc.major_grades[42] := ACalc.grades[42]; ACalc.major_credits[42] := ACalc.credits[42]; check := 1; end; end; if (frmCalculate.TabSheet8.TabVisible = True) then begin if (frmCalculate.CheckBox43.Checked = True) then begin ACalc.major_grades[43] := ACalc.grades[43]; ACalc.major_credits[43] := ACalc.credits[43]; check := 1; end; if (frmCalculate.CheckBox44.Checked = True) then begin ACalc.major_grades[44] := ACalc.grades[44]; ACalc.major_credits[44] := ACalc.credits[44]; check := 1; end; if (frmCalculate.CheckBox45.Checked = True) then begin ACalc.major_grades[45] := ACalc.grades[45]; ACalc.major_credits[45] := ACalc.credits[45]; check := 1; end; if (frmCalculate.CheckBox46.Checked = True) then begin ACalc.major_grades[46] := ACalc.grades[46]; ACalc.major_credits[46] := ACalc.credits[46]; check := 1; end; if (frmCalculate.CheckBox47.Checked = True) then begin ACalc.major_grades[47] := ACalc.grades[47]; ACalc.major_credits[47] := ACalc.credits[47]; check := 1; end; if (frmCalculate.CheckBox48.Checked = True) then begin ACalc.major_grades[48] := ACalc.grades[48]; ACalc.major_credits[48] := ACalc.credits[48]; check := 1; end; end; for i := 1 to 48 do begin total_pts := ACalc.credits[i] * ACalc.grades[i]; ACalc.total_points := ACalc.total_points + total_pts; ACalc.total_credits := ACalc.total_credits + ACalc.credits[i]; major_total_pts := ACalc.major_credits[i] * ACalc.major_grades[i]; ACalc.major_total_points := ACalc.major_total_points + major_total_pts; ACalc.major_total_credits := ACalc.major_total_credits + ACalc.major_credits[i]; end; //for final_QPA := (ACalc.total_points / ACalc.total_credits); frmCalculate_result.lblQPA.Caption := FormatFloat('0.0##', final_QPA); frmCalculate_result.lblQPA2.Caption := self.ReverseMath(final_QPA); frmCalculate_result.lblQPA3.Caption := IntToStr(ACalc.total_credits); if (check <> 0) then begin frmCalculate_result.lblMQPA.visible := True; frmCalculate_result.lblRQPA.visible := True; frmCalculate_result.lblMGrade.visible := True; frmCalculate_result.lblRGrade.visible := True; frmCalculate_result.lblMCredits.visible := True; frmCalculate_result.lblRCredits.visible := True; major_final_QPA := (ACalc.major_total_points / ACalc.major_total_credits); frmCalculate_result.lblRQPA.Caption := FormatFloat('0.0##', major_final_QPA); frmCalculate_result.lblRGrade.Caption := self.ReverseMath(major_final_QPA); frmCalculate_result.lblRCredits.Caption := IntToStr(ACalc.major_total_credits); end; ACalc.free; end; end.