I ate by mistake on a fast day,realized straight away and kept the rest of the day
Do I have to fast another day
No. You do not have to fast another day. The idea of fasting another day is basically when a person didn’t have to fast specifically on a certain day, and he broke his fast. That is when he has to make up the fast. However on days that the person has to fast on a specific day, such as on a taanis tzibbur, then halachically if the person mistakenly ate during the day, he still has to continue fasting the rest of the day, and he doesn’t have to make it up. There is however an idea of fasting as a kapara for the actual eating, however the poskim say that nowadays in order to get a kapara the person should give money to tzedakah.
M:B 568-8, Kaf Hachaim O:CH 549-7.