Dear Mr.Walker.
I am writing to apologize for not being able to attend your class yesterday morning.
Yesterday morning when l was on my way to attend your class,I suddenly had a stomachache.I had to hurry to the school clinic.When I came back.your class had already finished.I am terribly sorry for this incident.Please accept this letter of apology and the homework that I should have handed in yesterday.
Warm regards.
Your student,
Bob