Also came across this on uboat.net:
http://www.uboat.net/special/analysis.htm
It's an analysis of the attacks made by U-boats over the war and broken down into type. Here's a summary:
Torpedo only attacks were
3521, resulting in
2408 sinkings.
Torpedo & Gunfire were
209 in number, resulting in
191 sinkings.
Gunfire only attacks were
215 in number, resulting in
158 sinkings.
Thus attacks with gunfire represented about 8% of the total, if my sums are right.