One poll found that 39% of male voters will support a candid…
One poll found that 39% of male voters will support a candidate while another found that 43% of female voters will be in support. To test whether this candidate has a greater level of support by female than male voters, the alternative hypothesis should be:
Read DetailsWrite a function named is_palindrome that accepts a string p…
Write a function named is_palindrome that accepts a string parameter and returns true if that string is a palindrome, or false if it is not a palindrome. For this problem, a palindrome is defined as a string that contains exactly the same sequence of characters forwards as backwards, case-insensitively. Spaces, punctuation, and any other characters should be treated the same as letters; so a multi-word string or string with numbers or punctuation would count as a palindrome too. Below are some sample calls Function Call Value Returned is_palindrome(“madam”) true is_palindrome(“RacCAr”) true is_palindrome(“dog god”) true is_palindrome(“123 $$ 321”) true is_palindrome(“madham”) false is_palindrome(“antena”) false is_palindrome(“Taco cat”) false is_palindrome(TACOcat) true
Read DetailsDemonstrate your understanding of bitwise operations by eval…
Demonstrate your understanding of bitwise operations by evaluating the following expressions and writing their results in binary. unsigned char this = 0xa5; unsigned char that = 0x97; Expression Binary Result this [b1] that [b2] this & that [b3] this | that [b4] this ^ that [b5] ~this [b6] this > 1 [b8] (that >> 2) & 17 [b9] this & ~that [b10] ~that & (this
Read DetailsFill in the textboxes with the text that should go in the sp…
Fill in the textboxes with the text that should go in the spot on the same line with a _____ in the below code so that each variable is declared as the type it stores and each call to print_variable passes in an int*. Fill in the printf in print_variable so that the number stored in the parameter is printed. If a variable declaration will not work or a call is made using a variable that will not work write the word broken in the box. If no * or & are needed in a call write ok in the box. void print_variable(int* var) { printf(“%d\n”, ______); [a1] } int main() { int a = 4; ______ b = a; [a2] ______ c = *a; [a3] ______ d = &a; [a4] ______ e = &&b; [a5] ______ f = &d; [a6] ______ g = *f; [a7] print_variable( ____a ); [a8] print_variable( ____b ); [a9] print_variable( ____c ); [a10] print_variable( ____d ); [a11] print_variable( ____e ); [a12] print_variable( ____f ); [a13] print_variable( ____g ); [a14] }
Read DetailsConsider the following function: void mystery(int list[], in…
Consider the following function: void mystery(int list[], int length) { for (int i = 1; i < length; i++) { if (list[ i - 1 ] % 2 == 0) { list[ i - 1 ]++; list[ i ]++; } } } In the left-hand column below are specific arrays of integers. Indicate in the right-hand column what values would be stored in the array after the call to function mystery in the left-hand column. Write your answer surrounded by curly braces with number separated by commas. Original Contents of Array Final Contents of Array int a1[] = {12, 7}; mystery(a1, 2); [a1] int a2[] = {2, 3, 4, 5, 6}; mystery(a2, 5); [a2] int a3[] = {3, 4, 5, 7, 9}; mystery(a3, 5); [a3] int a4[] = {2, 3, 5, 7, 9}; mystery(a4, 5); [a4] int a5[] = {4, 5, 9, 6, 2}; mystery(a5, 5); [a5]
Read DetailsMadison Enterprises wants to hire a temporary secretary. The…
Madison Enterprises wants to hire a temporary secretary. There are two employment agencies in town, and it is believed that the average hourly wage charged by both agencies are the same, though wages frequently change based on market conditions. Means and standard deviations of wages charged by the two employment agencies over a 6-month period are shown below. Is the average hourly wage charged by the agencies the same? Test this claim at . Agency A Agency B $23.58 $24.02 $1.84 $1.57 23 27 a) 4 pts: Hypotheses: b) 1 pt: Specific test you are running (NOT just one or two tailed), 2 pts: Test statistic c) 2 pts: p-value or critical value d) 2 pts: Decision, 2 pts: Reason for the Decision e) 3 pts: Conclusion
Read DetailsWrite a function called num_unique that takes a sorted array…
Write a function called num_unique that takes a sorted array of integers and an integer repesenting the length of that array as parameters and that returns the number of unique values in the array. The array is guaranteed to be in sorted order, which means that duplicates will be grouped together. For example, if a variable called list stores the following values: {5, 7, 7, 7, 8, 22, 22, 23, 31, 35, 35, 40, 40, 40, 41} then the following call num_unique(list, 15) should return 9 because this list has 9 unique values (5, 7, 8, 22, 23, 31, 35, 40 and 41). It is possible that the array might not have any duplicates. For example if list instead stored this sequence of values: {1, 2, 11, 17, 19, 20, 23, 24, 25, 26, 31, 34, 37, 40, 41} then a call on the function would return 15 because this list contains 15 different values. If passed an empty array, your function should return 0. Remember that you can assume that the values in the array appear in sorted (nondecreasing) order. You are not allowed to use a temporary array, string or struct to solve this problem and you are not allowed to call library functions to help you solve it.
Read Details