It sounds as though you either have a faulty hard drive or less probably, an IDE control interface failure of the motherboard.
Whichever, it appears as though you have been sold a faulty machine and my first action would be to take the seller to task.
If that is not possible then you need to have it looked at professionally.
Obviously this will be expensive, although replacement of the hard drive itself is a simple procedure.
Whatever you decide depends upon how much you paid for it in the first place