Do I still have a chance of transferring to UCB,UCLA, or UCSD? (computer science major)

Here are my current stats at my current ccc:
(Fall 2017)
Math: B
Sociology: B
Physical Science: B

(Spring 2018)
History: D
Psychology: A
Philosophy: C
Physics: B
Math: D

Now, I know this looks bad, especially for someone aiming for such prestigious schools. For some context,( I’m not making excuses. I’m just explaining a bit. ) I have been diagnosed with ADHD and Bipolar Disorder, and I’m not blaming these disorders for my grades. Although, I would be lying if I said these disorders don’t affect my school performances, but I am more than willing to work harder for better grades. Also, these classes that I failed weren’t hard, like at all, that’s why I’m beating myself up about it so much because they weren’t hard and I could have done it right the first time. I’m just wondering if anyone else has had these type of grades and got their sh** together afterwards and was able to get into a good UC.
I’ll be applying at STEM Summer Robotics Institute at my school, and was wondering if this would be a good EC? Also, what kind of EC would be good to put in for a Computer Science major? I’m currently watching Harvard’s CS50 on youtube, and learning Python on Udemy, so my goal by around a year is to develop a website or app that I can take to small businesses or literally anyone. The point is to show that I am passionate about it.
Annnndd, I know computer science majors are supposed to be like gifted in math and should have all As and Bs in their classes no matter how rigorous they are. It’s not that I can’t handle math, I can, I know because when I pay attention I actually get it, the problem is, I don’t pay attention all the time. So I’m going to work on that.

Here are the 2017 admit ranges (25th-75th percentiles) by major and campus for CCC transfers. You want to be at or above the 50th percentile for the best chances. The D in Math will be problematic. Which Math BTW?

UC transfers are all about GPA foremost and completing your GE’s and major prep classes.

https://www.universityofcalifornia.edu/infocenter/transfers-major

I would try to TAG to UCSC or UCR so you have a solid acceptance on your list and then try for the other UC’s on your list.

http://admission.universityofcalifornia.edu/transfer/guarantee/index.html

I would suggest working harder at your current institution, since you might face worse situation after getting into more selective colleges. As a computer science major, you really don’t need a toptier brand. As long as you are technically competent and show that through projects and internships, you can also go into good firms in the end.

With a D in both math and history, it’s going to be a problem. Can you retake?

yes.