There is no way to answer this because there are simply too many variables involved.
Total cost of uc tuition–
Which campus? What major? How much do you plan to borrow to finance your undergrad? Are eligible for subsidized federal loans? Cal grants? What about room & board costs?
Total cost of med school–
Again that depends. What med school? Private? Public? If public, instate or OOS? (If you are CA resident, you’re living in the worst possible place to go in-state for med school. Too many highly qualified applicants; too few seats. 2/3 of CA applicants go OOS for med school.) What’s the local COL? Do you plan to live alone or with roommates? Do you own a car? (A necessity at many med school during clinical rotations since you will be stationed at sites some distance from the med school. You will also be working at odd hours when public transit doesn’t run.) What’s the cost of your mandatory health insurance? Your school fees? Books? Do you want to include the cost of national board exams prep, test fees and required travel to testing centers in your estimate? What about residency application fees & associated travel costs (which can easily run to $10,000 or more)?
Med school tuition varies from $16,000/year to over $70,000/year. Cost of living varies even more.
All federal loans for med school are unsubsidized and the interest rate is tied to certain government economic indexes so the interest rate changes changes every year.
Total debt
Highly dependent upon the choices you make, where you live, what schools you attend, what specialty you enter, what your salary as resident is, how expensive it is to live where you do your residency training. (The COL in Manhattan or San Francisco is vastly different from Oklahoma City or Lincoln, NE–and no, you do NOT get to choose where you do your residency. A computer program chooses for you.) And what the interest rates will do in the next 15 years. IOW, there’s no way to even begin to guess.
Specialty training last from 3 to 10 years, depending on your choice of specialty. Primary care fields are 3 years; surgery is 5 years. During residency you are paid about what you high school teacher earns. ($40K-$60/year) Residents cannot afford to pay down their loans during residency and many struggle to even keep up with the interest payments. Your education debt can easily double during residency if you do not pay 100% of your monthly interest to prevent it from capitalizing.
[Army Medicine](http://www.goarmy.com/amedd/education/hpsp.htm)
The above link will take you to the Army’s webpage for HPSP (Health Profession Scholarship Program) which will answer some/all of your questions about military service obligations. Note that your choice of specialties may be constrained by the needs of the service. You may be required to do a general medical officer tour (1-3 years) before you can match into a specialty. If you want to enter into competitive specialties (like ortho, ENT, opthal, derm, surgical specialties, etc), you may not be able to since the number of training slots for these are extremely limited. (There are only 5 training slots for Opthal every year for all the military services combined, for example.)
The terms of the HPSP are changing and the annual amount paid by the military towards your tuition is now capped. I believe there is now an annual ceiling of $40K. (So if you attend a more expensive med school, you will need to take out private or unsub federal loans in addition to the military’s contribution.)
NOTE; in order to qualify for HPSP, you must meet all the military’s physical and psychological guidelines. Something as simple as having asthma or a repaired hernia or a repaired ACL will DQ you. I’ve even heard of some candidates being DQ for needing corrective lenses (contacts or glasses).