Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2 For the upcoming Arkansas Presidential primary, favorability results for 4 candidates are given in ??. The second column in the table provides the

Question 2 For the upcoming Arkansas Presidential primary, favorability results for 4 candidates are given in ??. The second column in the table provides the number of people that view that candidate favorably. The third column in the table provides the number of people asked about each candidate. Number Favorable Number Questioned Candidate 1 500 700 Candidate 2 250 300 Candidate 3 333 800 Candidate 4 400 1000 Table 1: Favorability Results

a. Add code to H4_Q2 that declares and initializes a two-dimensional array named results with the integer values in columns 2 and 3 of Table 1.

b. In H4_Q2 add a constant array of doubles named condence_levels initialized with the values of 0.05, 0.025 and 0.01.

c. In H4_Q2 add code that calculates a 95% and 99% condence interval on the proportion of responses that were favorable for each candidate. Hint: use the NormalDistribution class to determine the z-value needed for in determining each condence interval.

d. (In H4_Q2) Print your results to the screen. Each row of your results should have the number of the candidate (e.g. Candidate 1), followed by the two condence intervals calculated for the candidate (in the same order given in part d.). For example: Candidate1: (.,25,.75); (.3,.5) is an example of what one row of output should look like. Note that the numeric results are not correct in this example.

package studentWork; import java.util.Arrays; public class H4_Q2 { public static void main(String[] args) { //Part a   //Part b   //Part c   //Part d  } } 
image text in transcribed
Number Favorable Number Questioned 500 700 300 333 800 400 1000 Candidate 1 Candidate 2 Cah lidate 3 Candidate 4 250 Table 1: Favorability Results Number Favorable Number Questioned 500 700 300 333 800 400 1000 Candidate 1 Candidate 2 Cah lidate 3 Candidate 4 250 Table 1: Favorability Results

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions

Question

Why are some industries more global than others? Discuss.

Answered: 1 week ago

Question

Distinguish between formal and informal communication.

Answered: 1 week ago