When I was studying for university entrance exams, I used to go to a cram school.
The physics class at that cram school was very fun.
That is the reason why I chose to major in physics.
ご質問ありがとうございます。
"When I was studying for university entrance exams"=「私が大学受験の勉強をしていたとき」
"I used to go to a cram school."=「私は予備校に通っていました。」
"The physics class at that cram school was very fun."=「その予備校での物理の授業はとても面白かったです。」
"That is the reason why I chose to major in physics."=「それが理由で、物理を専攻することを私は選びました。」
ご参考に。