Cylinder N* 3 not firing. Changed coil but there is no spark coming out. on 1994 Nissan Altima

Took car to autozone and code p0303 came up with 1217. The car can start and drive for a while and then it keeps shaking, losing idle and dies at red light. Can a defective head cause that? A mechanic told me it needs new head/block, but I think it is a matter of compression.There is a tapping noise coming around the valve cover.Please advise on what to do or focus on to get that car running.

Asked by for the 1994 Nissan Altima
i had a friend with same car 2.4L engine it keeps misfiring cylinder 1 and code p0301. start but rough idle and dies, your mechanic was right it needs new head but check first the compression if it is below 120lbs pressure then your engine is no good.
A bad head wouldnt cause a no fire condition,code 0303 means misfire in cylinder no. 3
1 more answer
With no spark it could be,the camshaft positioning sensor or it may be called the pick up coil if its inside the distributor,i assumed youve checked the spark plug and wire?