Question: Assume that you are writing a test driver for a function called count_diffs (), which accepts two strings s1 and s2 as parameters. The function

Assume that you are writing a test driver for a function called count_diffs (), which accepts two strings s1 and s2 as parameters. The function is supposed to return the count of how many letters are different between the two strings. For example, the number of differences between "aaaaa" and "aagag" is 2, because there are two places where the strings are not exactly the same. Assume also that two variables called test_value1 and test_value2 have already been initialized with values of "atgcaacg" and "atacagcc".. Write a block of code jo test the count_diffs () function using test_value1 and test_value2 together as the test case. The code should print out "error found" if the test detects an error, and otherwise prints nothing at all. Additional Notes: - test_value2 and test_value1 should not be modified - Regarding your code's standard output, CodeLab will check for case errors but will ignore whitespace (tabs, spaces, newlines) altogether. Assume that you are writing a test driver for a function called count_vowels (), which accepts any string s as a parameter. The function is supposed to return the count of how many vowels are in S. Recall that in English, the vowels are the set of letters {a,e,i,0,u}. Assume also that a variable called test_value has already been initialized with a value of "evolution". Write a block of code to test the count_primes () function using test_value as the test case. The code should print out "error found " if the test detects an error, and otherwise prints nothing at all. Additional Notes: - test_value should not be modified - Regarding your code's standard output, CodeLab will check for case errors but will ignore whitespace (tabs, spaces, newlines) altogether
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
