The clue is often in the question. Pseudo code is plain Engligh used to describe a set of steps (objectives) required to do something. For example, if we take your spec. and break it down into objectives…1. determine the winning candidate for a constituency in the national elections 2. accept as input the names of the four candidates and the number of votes each candidate receives. (The successful candidate is the one who received the most votes.) 3. Print the name of the winner and the number of votes he/she received. …and then check the order of objectives: it’s pretty logical that we need to know candidate names and how many votes before we can find a winner, and we need to know who the winner is before we can output the winner name and votes. – So our list of objectives becomes… 1. accept as input the names of the four candidates and the number of votes each candidate receives. (The successful candidate is the one who received the most votes.) 2. determine the winning candidate for a constituency in the national elections 3. Print the name of the winner and the number of votes he/she received. …Finally, we need to convert each objective into pseudo code; just break each objective down into smaller steps. {required variables} define a variable array of strings for candidate names define a variable array of whole numbers for candidate votes define a single string variable for the winner define a general purpose counter ‘i’ for loops in code define a general max variable number to hold highest number of votes {1. accept as input the names of the four candidates and the number of votes each candidate receives. (The successful candidate is the one who received the most votes.)} start a loop setting ‘i’ from 1 to 4 write text to screen ‘enter candidate name: ‘ read candidate name write text to screen ‘enter number of votes for
: ‘ read number of votes next loop {2. determine the winning candidate for a constituency in the national elections} set winner equal to the first candidates name set max equal to the first candidates votes start a loop setting ‘i’ from 2 to 4 if candidate ‘i’ votes greater than max then set max equal to that candidates votes set winner variable equal to that candidates name next loop {3. Print the name of the winner and the number of votes he/she received.} write text to screen ‘the winner was
with
votes’ exit the program
Consider Your Assignments Done
See Why Our Clients Hire Us Again And Again!
Success Guarantee
When you order form the best, some of your greatest problems as a student are solved!








Jermaine Byrant
Nicole Johnson



