Project 39: 2-Way Prob A Given C

Intro Problem: A random sample of 100 adults was taken.  Each participant was asked their gender and whether they prefer dogs or cats.

Based on the table above:

P(Dog) = 51/100 = .51

P(Cat) = 49/100 = .49

P(Male) = 52/100 = .52

P(Female) = 48/100 = .48

Project 39:  A two-dimensional array called 'twoWay' has been initialized.  The array represents a two-way table as shown above.  

Task: Appropriately initialize the value of 'probAGivenC' that represents the probability of A given C.

Note: 

twoWay[0][0] is the value at row 0, column 0 which holds the frequency for A and C.

twoWay[0][1] is the value at row 0, column 1 which holds the frequency for B and C.

**If your code works for 5 test cases, you can enter your e-mail address

Universal Computational Math Methods:

pow(5,2) returns 25.0

abs(-3.0) returns 3

sqrt(49.0) returns 7.0