Answer:
PROCEDURE calculate_refund(candidates, votes_received, votes_cast)
refund_due = 0
FOR i = 0 TO LENGTH(candidates) - 1
IF votes_received[i] >= 0.2 * votes_cast
PRINT candidates[i] + " Refund Due"
refund_due = refund_due + 1
ELSE
PRINT candidates[i] + " No Refund"
END IF
END FOR
PRINT "Number of candidates who received a refund: " + refund_due
END PROCEDURE
Step-by-step explanation:
This algorithm takes as input the names of the candidates, the votes received, and the votes cast in the constituency. It loops through each candidate, and if the number of votes received for that candidate is equal to or greater than 20% of the votes cast in the constituency, it prints the candidate name and "Refund Due". If the number of votes received is less than 20% of the votes cast, it prints the candidate name and "No Refund". Finally, the algorithm prints the number of candidates who received a refund.