What can I do if I get a B related to a major I want to do in college?

I’m getting a B in AP Comp Sci A, sophomore year. If I get a 5 on the AP exam, would that counter the B? I’m also taking a higher level comp sci class that my school offers next year, so if I get an A in that, would that also counter this B?

Don’t be so upset over one B. That single grade won’t make or break you. Just continue to put in good effort.