Professional Documents
Culture Documents
Algorithm and Trace Table
Algorithm and Trace Table
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
7 candidates received a
refund