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 '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 ((assign1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
