Consider the pseudo-code below for computing insurance premium.(i) Draw the program graph(ii) Comput

Consider the pseudo-code below for computing insurance premium.(i) Draw the program graph(ii) Compute the cyclomatic complexity(iii) Derive a set of basis paths that can be used to test the program(iv) Given that the baseRate is $500.00, create the test cases that will exercise all the branches for switch case C4 only. The test cases should show the inputs, the path taken and the expected output. [Hint: There should be only two test cases.]1 program compute_insurance_premium()2 integer driverAge, points3 real baseRate, premium4 Input(baseRate, driverAge, points)5 safeDriveFactor = 0.06 premium = 0.07 switch (driverAge) {8 case C1: 16 <= driverAge < 259 ageFactor = 3.010 if points < 2 then11 safeDriverFactor = 4012 end if13 break; // End Case – C114 case C2: 25 <= driverAge < 4515 ageFactor = 2.216 if points < 3 then17 safeDriverFactor = 4018 end if19 break; // End Case – C220 case C3: 45 <= driverAge < 6521 ageFactor = 1.522 if points < 5 then23 safeDriverFactor = 8024 end if25 break; // End Case – C326 case C4: 65 <= driverAge < 10027 ageFactor = 2.028 if points < 2 then29 safeDriverFactor = 12030 end if31 break; // End Case – C432 default:33 Output("Driver age out of range.")34 } //End switch35 premium = baseRate * ageFactor - safeDriverFactor36 Output(premium)

Don't use plagiarized sources. Get Your Custom Essay on
Consider the pseudo-code below for computing insurance premium.(i) Draw the program graph(ii) Comput
For $10/Page 0nly
Order Essay
Calculator

Calculate the price of your paper

Total price:$26

Need a better grade?
We've got you covered.

Order your paper