191k views
2 votes
To win an election in Ghana, a presidential candidate must have 50% plus one of the total valid votes counted.assuming x and y are two presidential candidates for party manU and Chelsea respectively, write a program to request for the total valid votes counted,total valid vote for x and y should any of them obtain 50% plus one of the total valid votes counted that candidate should be declared as winner if none of them obtained the 50% plus one of the total valid votes counted. The program should request for a re-run of the election

1 Answer

2 votes

Answer:

Total valid votes:

X:

Y:

if X + Y >= 50% + 1 of total valid votes

if X > Y

print "X is the winner!"

elif X < Y

print "Y is the winner!"

else

print "It's a tie!"

else

print "Re-run the election"

User David Ortiz
by
8.4k points