Question: The program CA combines the marks for two assessments'assignl' and 'assign2 mark into a single grade. The marks value for both assignments is an integer.

 The program CA combines the marks for two assessments'assignl' and 'assign2mark into a single grade. The marks value for both assignments isan integer. If the marks for either assignment is less than 50%then the grade returned is a 'Fail'. To pass the CA with

The program CA combines the marks for two assessments'assignl' and 'assign2 mark into a single grade. The marks value for both assignments is an integer. If the marks for either assignment is less than 50% then the grade returned is a 'Fail'. To pass the CA with a 'Pass, C', the student must score between 50% and 60% (inclusive) in 'assign1' or 'assign2'. They will pass the course with at least a 'Pass, B', if they score greater than 60% in both 'assign1' and 'assign2'. In addition to this, if the average of assignl' and 'assign2' is 80% or more, then they are awarded a 'Pass, A'. An input values that is less than 0 or greater than 100 for either assignment is invalid, and the program will return a message: 'Marks out of range'. Line Code No. 1 public static String CA (int assign1, int assign2) { 2 String result="null"; 3 long average = Math.round((assign1+assign2)/2); 4 if ((assign1100) || (assign2100)) 5 result="Marks out of range"; 6 else { 7 if ((assign1=50 && assign1=50 && (assign2= 80) { 14 result="Pass. A"; 15 } 16 else { 17 result="Pass,B": 18 } 19 } 20 return result; 21 } Complete the Control Flow Graph (CFG) for the program CA() using the source code provided. Write the correct line number of the code associated with each node in a table like the one provided. Then, derive test cases and test data for the White Box Software testing method of All- Path Testing. Ensure to show the nodes covered by each set of test data (15 marks] CFG 9 10 Node Lines numbers Code 1 2 3 4 5 6 7 8 9 10 Test Data Test No. Nodes Covered Inputs Expected Outputs assign1 assign2 Result 1 N 3 4 5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!