I have been sleeping 12 hours a day and eating once a day getting bad headaches and throwing up what could be wrong with me?

See your doctor. The important bit of information is how long this has been going on. It could be a simple viral infection but that shouldn't last more than a day or two. If it is still going on past three days you should see your doctor.