pseudocode http://www.mediafire.com/view/2sm3o07c404bgxj http://www.mediafire.co
ID: 3770934 • Letter: P
Question
pseudocode
http://www.mediafire.com/view/2sm3o07c404bgxj
http://www.mediafire.com/view/934gxglf9tk3e1g
I don't need any coding just simple pseudocode to go along this problem. Checks these links out to see how I have done a couple module problems to get an idea at these links You are given two parallel arrays listed below that already contain the candidate names and the number of votes that each candidate received. You are to develop three modules to do the following: In module 1, output all candidate names and the number of votes the candidate received. In module 2, calculate and output the candidate name and the number of votes for the candidate with the highest number of votes. In module 3, output the candidate name and number of votes for all candidates with over 10 votes. Pseudocode for each moduleExplanation / Answer
module_1(Candidate,Vote):
n = size(Candidate)
for i = 1:n
print Candidate[i] +" " + Vote[i]
end
module_2(Candidate,Vote):
n = size(Candidate)
max = -1;
index = -1;
for i = 1:n
if (Vote[i] > max)
max = Vote[i];
index = i;
end
end
print Candidate[i] + " " + Vote[i]
module_3(Candidate,Vote):
n = size(Candidate)
for i = 1:n
if (Vote[i] > 10)
print Candidate[i] + " " + Vote[i]
end
end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.