0% found this document useful (0 votes)
111 views2 pages

IT Pseudocode SBA

This pseudocode collects data about national elections from 10 constituencies. It collects the constituency name and number of registered voters for each. It then collects data for each party contested in each constituency, including party name, candidate name, and votes received. It calculates the total votes and voter turnout percentage for each constituency. It also tracks the winning candidate for each constituency by party, name, and votes. Finally, it prints the election data collected for each constituency.

Uploaded by

Raph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
111 views2 pages

IT Pseudocode SBA

This pseudocode collects data about national elections from 10 constituencies. It collects the constituency name and number of registered voters for each. It then collects data for each party contested in each constituency, including party name, candidate name, and votes received. It calculates the total votes and voter turnout percentage for each constituency. It also tracks the winning candidate for each constituency by party, name, and votes. Finally, it prints the election data collected for each constituency.

Uploaded by

Raph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Pseudocode

National Elections Algorithm

Start

For I = 1 to 10 Do (*collecting const name & number of reg. voters*)


Begin
Print “Enter constituency name:”
Accept constituency [ I ]
Print “Enter number of registered voters for the constituency entered:”
Accept NRV [ I ]
ENDFOR
For J= 1 to 10 Do (*collecting data for each constituency*)
Begin
Total_votes [ J ] = 0
Highest_votes [ J ] = 0
Print “How many parties contested in”, constituency [ I ]
Accept number
For K= 1 to number do (* accepting data for each party*)
Begin
Print “Enter party acronym:”
Accept party [ K ]
If K<= number then

Begin
Print “Enter candidate name for “ , Party [ K ]
Accept name [ K ]
Print “Enter votes received by” , name [ K ]
Accept votes [ K ]
(*Calculating the numbers of votes in each constituency & voter turnout*)
Total_votes [ J ] = total_votes [ J ] + Votes [ K ]
Perc_votes [ J ]= total_votes [ J ] / NRV [ J ] * 100
(*finding details for winning candidates*)
If votes [ K ] > highest_votes [ J ] then

Begin
Highest_votes [ J ]= votes [ K ]
Highest_name [ J ]= name [ K ]
Highest_party [ J ]= party [ K ]
End if
(*finding the amount of candidates in each constituency*)
Cand_no [ J ] =number
End if
ENDFOR
ENDFOR
For L = 1 to 10 DO
Begin
Print cand_no [ L ]
Print total_votes [ L ]
Print perc_votes [ L ]
Print highest_votes [ L ]
Print highest_name [ L ]
Print highest_party [ L ]

EndFOR

Stop.

You might also like