It could be a variety of things that could cause the CHECK ENGINE to come on. The car's Computer Monitors different sensors so that the car's emission is below smog limits. If the computer saw a reading that was above or below the sensor's limit, it will set the CHECK ENGINE light. Not tightening the gas cap will turn on the light. It might affect driveablity, i.e. rough idle.
In my experience with my Chevy it was a ground wire
with me it was the o2 censer
You need to check all of the mounts. Get a manual to show you where they are.
The vacuum lines for a 2000 Cavalier are located all over the engine bay and under the dash. A break in any line can cause rough running.
Low fuel pressure
What would cause the engine not to restart when hot Chevy Trailblazer 2007?
Engine overheating. Check the radiator for leaks in the hose pipe or radiator, otherwise the water pump is faulty and will need replacing
have you checked your fuses?
can a chevy truck with a 350 engine with a tbi cause detonation and pre- ignition?
Many different things you need to take it in to a auto zone parts store and they will put a scanner on it for free and give you the codes it has stored and how to fix it.
Bad heater core.
The 2005 Cavalier could have a fuel leak. Have the entire fuel system checked, as a fuel leak can cause a dangerous fire.