I have an iMac and the bluetooth mouse and keyboard stoped responding last week. At first the bluetooth connection was dropping and reconnecting every 30 seconds or so. When I was able to connect I went through the PRAM and SMC reset and that didn't fix it. Now they will not connect at all. I went and bought a USB mouse and keyboard thinking it was just a bluetooth issue but those do not work either.
Hang on. Is that a wired keyboard and mouse? If so, you've got bigger problems than just BT connectivity.
The BT issue may be some local interference. Try turning off other nearby devices, or move the iMac to another location and test there.
Look at the System Report app to see if the USB ports/devices are all listed. Might be difficult without any input capabilities, I know. Try plugging the devices into each of the USB ports.
I've read that reinstalling the OS might fix it
This isn't Windows, where any problem demands a wipe and reimage!
Reinstalling is rarely necessary, and there are many things to test before considering that.
Such as: create a brand new user account, and see if the problem still occurs. If it doesn't, then the problem is isolated to your original user account, and so is most likely a preference or process running there.
I had a CD in the drive when this started and I can't get it out.
Did this happen at the same time? Let's not jump to assume that coincidences are connected, but ....
Try the advice for getting a disk out as given above.
This thing is less than 2 years old and the entire reasoning behind purchasing it was that the Mac would last much longer than a PC! Hope I wasn't wrong about that.
Macs
generally last a long time and continue to be useful for several years. Is any
particular Mac immune from hardware problems? No. Any machine can get a failing hard drive, blown Power unit, fried logic board, depending on local operating conditions, luck, and whether the unit left the factory on a Friday afternoon.