Answer:
You're correct
You can alternatively sayおなかがすいたときにたべます。as well, but your sentence is perfect.
Kanji version of what you wrote would be: 私はお腹がすいた時に食べます。
???what is your question exactly
The people of madyan
The People of Madyan: The people of Madyan were Arabs who lived in the country of Ma'an, part of which today is greater Syria. They were a greedy people who did not believe that Allah existed and who led wicked lives. They gave short measure, praised their goods beyond their worth, and hid their defects.