2002 pontiac grand prix

my car is shaking and keeps cutting off and seems to accelerate on it own sending the RPM GUAGE all over the place. what could it be?