Professional Documents
Culture Documents
contesting the election. It also accept the position they are contesting and
the number of votes that they recieve in each form. The program calculates
total votes and determines the winner of for each position...}
Program DerickTidort;
uses crt;
Var
candidate_name:array[1..19]of string;
position:array[1..19] of char;
form_1:array[1..19] of integer;
form_2:array[1..19] of integer;
form_3:array[1..19] of integer;
form_4:array[1..19] of integer;
form_5:array[1..19] of integer;
total_votes:array[1..19] of integer;
count,num:integer;
S,T,V,P,R:integer;
a,c:integer;
winnerP,winnerV,winnerS,winnerT,winnerR:integer;
begin
clrscr;
gotoxy(10,3);
textcolor(green);
writeln('************************************************************');
gotoxy (28,5);
textcolor(green);
writeln('SGA ELECTION ANALYSIS');
gotoxy(10,7);
textcolor (green);
writeln('************************************************************');
textcolor(green);
for count:= 1 to 6 do
begin
textcolor(yellow);
writeln('Please enter the name of a candidate.');
readln (candidate_name[count]);
textcolor(white);
writeln('Which position did ',candidate_name[count],' win?');
textcolor(white);
writeln('choose');
textcolor(white);
writeln('P for president');
textcolor(white);
writeln('V for Vice President');
textcolor(white);
writeln('S for secretary');
textcolor(white);
writeln('T for Treasurer');
textcolor(white);
writeln('R for Public Relation Officer');
textcolor(white);
readln(position[count]);
writeln('enter votes for form 1');
readln(form_1[count]);
writeln('enter votes for form 2');
readln(form_2[count]);
TOTAL VOTES');
begin
if (position[c]) = ('P') then
writeln(candidate_name[c],'
tes.');
if (position[c]) = ('T') then
writeln(candidate_name[c],'
tess.');
President
',total_votes[c],'vo
Treasurer
',total_votes[c],'vo
',total_votes[c],'vo
Secretary
',total_votes[c],'vo
Vice President
',total_votes[c],'vo