You are on page 1of 2

Algorithm: RefundCalculator 

Start 
Declaration of Variables 
String: Candidate Name 
Integer: VotesReceived, VotesCast, Refund, Candidates
Initialization of Variables 
VotesReceived = 0 
VotesCast = 0 
Refund = 0 
For Candidates = 1 to 10 Do 
Print “Enter Candidate Name:” 
Read CandidateName 
Print “Enter Votes Received” 
Read VotesReceived 
Print “Enter Votes Cast” 
Read VotesCast 
If VotesReceived > 20/100 * VoteCast Then Print
CandidateName, “Refund Due” 
Refund = Refund + 1 
Else 
Print CandidateName, “No Refund” 
Refund = Refund 
End For 
Print Refund, “Candidates Received
Trace Table

Candidates  Candidate Votes   Votes Refund  Output


Names Received  Cast 

1  Sumira Ramnauth 1913  7650 0+1 Sumira Ramnauth


Refund Due

2  Caroline Smith  1730  8649 1 Caroline Smith


No Refund  

3  Renesha Fraser 3292   1+1 Renesha Fraser


9405 Refund Due

4  Tevon Morrison 2208 11040 2 Tevon Morrison


No Refund Due

5  Shemar Bess 4048 10120  2+1 Shemar Bess  


Refund Due

6  Tamika Moore 3010   3+1 Tamika Moore


8600 Refund Due

7 Vanessa Hopkinson 2351 9405 4+1 Vanessa Hopkinson


Refund Due

8 Oliver Singh 1584 7921 5 Oliver Singh


No Refund

9 Yonelle Fordyce 4416 11040 5+1 Yonelle Fordyce


Refund Due

10 Adelicia Adams 2530 10120 6+1 Adelicia Adams


Refund Due

7 candidates received a
refund

You might also like