Is it permissible for one to masturbate in order not to commit fornication?
This is called committing the milder of the two evils such as eating a carcass in fear of death, and this happens when committing fornication is very likely to occur.
Is it permissible for the doctor to uncover the hair of a female patient out of necessity?
It is only permissible for him to do so when there is no female doctor, and he should examine the patient in the presence of one of her Mahrams (unmarriageable kin).
I`m a university student. While I was sitting for an exam, the professor caught my fellow student cheating. I heard him telling her to hide the dossier. After the exam, he asked me to testify that I saw her cheating although I heard him telling her to hide the dossier but didn`t see her cheating. What is the ruling of Sharia on this?
All perfect praise be to Allah the Lord of The Worlds. May His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
It was narrated that the Prophet (PBUH) said to a man: "Do you see the sun?" He replied: "Yes." He said: "Give witness in a similar case [which is as clear as the sun], or leave it." [Reported by Al-Baihaqhi in "Sho`ab Al-Eman" pp.10964]. Therefore, it is not permissible to testify about something that you haven`t actually seen. And Allah The Almighty Knows Best.
Is wearing a cap permissible for boys, or girls?
All Perfect Praise is due to Allah, The Lord of The Worlds.
In principle, anything is permissible sol long as there is no Sharia evidence prohibiting it, thus wearing the cap by boys is permissible as long as it isn`t done in imitation of the disbelievers. Moreover, a Muslim woman should avoid all that which attracts the attention of men because whatever leads to the forbidden is forbidden. And Allah Knows Best.