IBM 5110 Basic Introduction page 129

Table of Contents

Advertisement

("""
Problem 3
Here are the results of an election:
Candidate
District 1
District 2
District 3
Adams
Biller
Campbell
4106
3729
4002
2890
3515
3131
2981
2493
3012
Figure out the total vote and what percent of the total each candidate
received.
The Program
o
0
1.
0
~i ~;:::
I
(~D i~"1
i " 1 E:
I
0020 A=4106+2809+2981
o
0
:.?:;
0 B
.~;
::; , B ILL E H
I
0040 B=3729+3515+2493
o
0
~.:5
0 C
'~i
:::: '
C
PI
I' ; , P B [: L
I... '
o
I)
f.:.
0 C ::::
' +
(I I]
2 + ::5 1 :.3 :I. +
::3
0 1
::?
o
0
<O{'
0 l ::: tl + f·: + C
00 H 0
i~11
:'-':(.:-I./T
o
0 9 0 I{ 1 ::: B ,/ T
o
1
(I
0 C 1 :::: C ,/
'r
o
1 1 0
r~
E
t,)
P
r-;~
I N T T D
'r ()
L, \/ D
01::20
PPINT l
o
:l. 3
[I
P
F,~
I N T
tl'~:','
t!
!
tl J
0140 PRINT
B$JBIBl
0150 PRINT CS,C,C!
Exercises
125
("""
Problem 3
Here are the results of an election:
Candidate
District 1
District 2
District 3
Adams
Biller
Campbell
4106
3729
4002
2890
3515
3131
2981
2493
3012
Figure out the total vote and what percent of the total each candidate
received.
The Program
o
0
1.
0
~i ~;:::
I
(~D i~"1
i " 1 E:
I
0020 A=4106+2809+2981
o
0
:.?:;
0 B
.~;
::; , B ILL E H
I
0040 B=3729+3515+2493
o
0
~.:5
0 C
'~i
:::: '
C
PI
I' ; , P B [: L
I... '
o
I)
f.:.
0 C ::::
' +
(I I]
2 + ::5 1 :.3 :I. +
::3
0 1
::?
o
0
<O{'
0 l ::: tl + f·: + C
00 H 0
i~11
:'-':(.:-I./T
o
0 9 0 I{ 1 ::: B ,/ T
o
1
(I
0 C 1 :::: C ,/
'r
o
1 1 0
r~
E
t,)
P
r-;~
I N T T D
'r ()
L, \/ D
01::20
PPINT l
o
:l. 3
[I
P
F,~
I N T
tl'~:','
t!
!
tl J
0140 PRINT
B$JBIBl
0150 PRINT CS,C,C!
Exercises
125

Advertisement

Table of Contents
loading

Table of Contents