I have shooting pains in my right knee and it hurts to straighten it out after it has been bent for a small time and hard to walk. What should I do?

Formal evaluation. Sounds serious enough that you should consider a formal eval and x-ray by an orthopedic surgeon. Sounds likely to represent kneecap problems, cartilage and/or tracking. For now avoid kneeling, crawling and squatting, especially lounges and squats. Ibuprofen could help. Strengthen the thigh just above the kneecap, using terminal extension exercises(from fully straight to 50 degrees bent only).
Knee pain. Your pain is likely secondary to patellofemoral syndrome or degenerative joint disease -- a thorough exam from your primary care provider (and maybe an xr) would be very helpful. There are many successful treatment options for knee pain!