I am not convinced that the hard drive is bad. If the hard drive was failing, there should have been an indication of that when you ran the hard drive diagnostics. Instead, your issue may be a configuration, software, or corruption issue. Installing a fresh copy of Windows will clearly rule out configuration, software, or corruption as the cause... leaving only the hard drive or other hardware as the cause of your problems.
Download both the Windows 7 ISO and the USB/DVD tool to the desktop of a fully functional Windows computer. Run the USB/DVD tool download... this should install the "USB/DVD tool". Next, run the USB/DVD Tool that was just installed on the computer. When it asks for the Windows ISO... point it to the Windows 7 ISO you just downloaded. Now, either create a Windows 7 USB Flash drive or a Windows 7 DVD.
Again, the Windows 7 download isn't the official HP Recovery Disc set and you will not have any of the original HP provided software when done. You will need to purchase HP Recovery Discs if you didn't already create them.
Please click the white KUDOS star to show your appreciation