A gun is not a magic wand. Just having it is not going to make the bad guy move on. To be effective, the bad guy must look at you and have total certainty that you WILL blow him away if he doesn't run away quickly. Mental attitude is key.
If price is an issue, an SKS rifle is fairly cheap (I saw them for under $200 at a gun show three months ago), 7.62x39 ammo is fairly cheap ($127 for a 500 round case), and is a demonstrated man-stopper.
And they are easy to shoot, so a neophyte might actually practice with one. It was my first centerfire anything. Don't shoot it much anymore, I find my M1 Cargine to be more fun, but they are much more expensive. YMMV.