Since you have a second Mac, I would suggest this:
DO THIS ON YOUR OTHER WORKING MAC:
First, PRINT OUT these instructions for reference.
Get a USB flash drive 16gb or larger.
Download the OS installer of your choice.
I'd suggest 10.12 Low Sierra.
You should be able to get it here:
Use any of these methods to download and install current or previous versions of the Mac operating system on compatible Mac computers. Each macOS includes the latest built-in apps available for that macOS, including Safari, Mail, and Apple Music (formerly iTunes).
support.apple.com
I -think- this downloads as a "pkg" file.
If you run the pkg, it places the installer app into your applications folder.
DON'T RUN THE INSTALLER.
Now, download one of the following:
- DiskMaker X
or
- Install Disk Creator
(search for them with google, they'll show up quickly)
IMPORTANT:
You need to download THE RIGHT VERSION (of either of the above apps) for the OS installer you're going to create.
With either of the above apps, it's easy to create a bootable USB flash drive with just a few clicks of the mouse.
When this is done:
NOW take the bootable flashdrive to the iMac you're going to install onto.
Boot up holding down the option key CONTINUOUSLY until the startup manager appears.
You should see the flash drive installer available as a boot drive.
Click on it with the pointer and hit return.
Do you get a good boot into the installer?
OK, at this point you need to make a decision.
You can either try installing onto the drive "as it is",
or
You can erase it with disk utility and "start completely clean".
This decision is UP TO YOU.
If you want to erase and install, you need to QUIT the installer for the moment and go to the OS utilities.
Open disk utility and look at the list "on the left".
Locate the line that represents the PHYSICAL DRIVE inside the iMac.
Click on it to select it.
Now click "erase".
Choose "Mac OS extended with journaling enabled, GUID partition format".
Then click through with the erase, it won't take long.
When done, quit disk utility and re-open the OS installer.
Begin clicking through.
The iMac may restart one or more times, and the screen may go black for a minute or two before doing anything else.
BE PATIENT.
IF you get an error message when installing, be aware that some Apple installers have "expired certificates", and it may be necessary to reset the internal clock before running the installer.
Don't fret over this if it happens, just come back here and get more help.