Project 13: 2-Way Prob A or D
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(Male and Dog) = 42/100 = .42
P(Female and Cat = 39/100 = .39
Project 13: 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 'probAOrD' that represents the probability of A or D.
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