New GPA = (Old GPA x number of previous credit hours) + (New GPA x number of new credit hours) / Total number of credit hours
In this case, you started with a 2.0 GPA and got a 4.0 this semester. Let's assume you previously took 30 credit hours and took 15 credit hours this semester.
New GPA = (2.0 x 30) + (4.0 x 15) / (30 + 15)
= (60 + 60) / 45
= 120 / 45
= 2.66
Therefore, your new GPA is 2.66 after this semester.