I am having a bit of trouble with something that I imagine is fairly easy.

I am wondering how to get the probability of alarm, JohnCalls, and MaryCalls if they have no prior knowledge of their parents.
I assumed P(A) = P(A|B,E)P(A|B,!E)...=.95.94*.29*.001 = .00026
However, I can't make sense of this, as that is even lower than if there were no Burglary or Earthquake at all. Likewise with JohnCalls, if JohnCalls even when there is no alarm 5% of the time, .90*.05 < 5% and that makes no sense to me.
I assume there is an easy solution to this, so thank you for your patience.
Also, I am trying to create this in a java program, and am having a bit of difficulty. Can anyone recommend a good tutorial for a problem like this that will help me create a program in which I could query anything to do with a graph like this? Thanks again!
I can add something to start an answer, but I'm no Java expert, sorry!
$$\mathsf P(A) = \sum\limits_{b\in\{B,!B\}}\sum\limits_{e\in\{E,!E\}} P(A, b, e)$$
This is because of the partition rule of probability (more of an explanation is here ). (Also known as the Total Probability Theorem, or Law of Total Probability.)
Recall from conditional probability: $\mathsf P(A, B) = \mathsf P(A \mid B)\cdot\mathsf P(B)$ .
So $\mathsf P(A, B, E) = \mathsf P(A\mid B,E)\cdot\mathsf P(B,E)$, for example.
Which means:
$$\begin{align} \mathsf P(A) = & {\mathsf P(A \mid B, E)\mathsf P(B, E) + \mathsf P(A\mid B, !E)\mathsf P(B, !E) \\ + \mathsf P(A\mid !B, E)\mathsf P(!B, E) + \mathsf P(A \mid !B, !E)\mathsf P(!B, !E)}\end{align}$$
This is because the there are 4 ways in which A can happen. A can happen if events B and E happen, if B happens and not E, if E happens and not B, or if neither of them happen.
Working that out (and assuming B and E are independent), we have:
$\begin{align}\mathsf P(A) = & (0.95\cdot 0.001\cdot 0.002) + (0.94\cdot 0.001\cdot 0.998) + (0.29\cdot 0.999\cdot 0.002) + (0.001\cdot 0.999\cdot 0.998)\\[1ex] = & 0.002516442 \end{align}$
Using the same principle, you can get P(John calls) and P(Mary calls):
$$\begin{align} \mathsf P(\text{John calls}) = & \mathsf P(\text{John calls}\mid A)\mathsf P(A) + \mathsf P(\text{John calls}\mid !A)\mathsf P(!A) \\[1ex] = & 0.9\cdot 0.002516442 + 0.05\cdot (1-0.002516442) \\[1ex] = & 0.052\text{(truncating)} \\[3ex] \mathsf P(\text{Mary calls}) = &\mathsf P(\text{Mary calls}\mid A)\mathsf P(A) + \mathsf P(\text{Mary calls}\mid !A)\mathsf P(!A)\\[1ex] = & 0.7\cdot 0.002516442 + 0.01\cdot (1-0.002516442) \\[1ex] = & 0.012\text{(truncating)}\end{align}$$
Hope that helps on the probability side of things! Does anyone see an error with this?