Question: Assume that you are testing a function called count digits (), which accepts any integer as a parameter. The function is supposed to return

Assume that you are testing a function called count digits (), which

Assume that you are testing a function called count digits (), which accepts any integer as a parameter. The function is supposed to return the number of digits in that integer. For example, for an argument of 142, the function should return 3. However, suppose you know that the function contains an error, and that there will be some arguments for which the function will return the wrong value. Write a function call to count_digite() using an argument that you think would make a good test value. You may have to try s everal different test values before you find one that reveals the error.

Step by Step Solution

3.34 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To test the countdigits function and potentially reveal an error you can choose a test value that in... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!