Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 18 (10 marks) One form of testing software t once. For the code snswer

ID: 3717171 • Letter: Q

Question

Question 18 (10 marks) One form of testing software t once. For the code snswer equires that each path through the oode be eecuted at least egment below answer the followitng, questions (a) hat ia the total number of possible paths? (b) te the testing sethod proposed ia qusstion esibis rsi) read (kmax) read (ax) //kmax isan integer b.tueen 1 8nd 18 .-? . read( myChar ) // myChar is the character A. " or ? svitchC myChar) if cond1 biockC break; case 'B blockB if( cond2 blockc break case 'C blockC; break; blockD;

Explanation / Answer

a) Total number of paths possible are 3 defined by each case in switch block depending on the value of myChar

b) Switch case is designed such that only case C is calling one block that is blockC but other two cases are covering two blocks so switch case if reasonable. But value picked up by kmax is 1 to 18 which is not reasonable, this should be increased to atleast 10 to 18 so that to decrease the probability of picking case C every time in switch case.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote