Program 4/~$AD FOR WHAT TO DO.docx
Program 4/READ FOR WHAT TO DO.docx
Purpose
This program will provide an opportunity to solve a problem related to two-dimensional arrays.
Specifications
You are required to summarize a very large set of voting data. The data are contained in the file votingdata.txt
The format of the file includes one of the four candidates (identified by code A, B, C, or D). The second item in each line is an integer that identifies the voting precinct (1-5).
The objective is to count and summarize the vote in a report something like the following. PRECINCT 1 2 3 4 5 TOTAL A xxx xxx xxx xxx xxx xxxx B xxx xxx xxx xxx xxx xxxx C xxx xxx xxx xxx xxx xxxx D xxx xxx xxx xxx xxx xxxx TOTAL xxxx xxxx xxxx xxxx xxxx Candidate X is the winner!
Utilize a two-dimensional array of counters to accumulate all of the given fields of information and perform the required counts.
Use tons of comments!!!
Program 4/votingdata.txtA4B1B4C3A4A2C4C2B2B5C2D5B2C1B2C4B4D4D2D4B5D5D3A2B4B1D2D2B4A2D4A2C2C1B5A1A3D1D4C3B2B1D1C1B1B1A3B5C3B4B2D5C3D1B1A3A4B4A4D3A3C2D5C3A2B5B4D2A1D5A2B4D3D5D1A1C2D5B1B2A1D5A1C4B1D1C5B2C1C2A1D5D5C4D3B3A5C1D3D1B3A5C2A4B2D1A1B4D4D1B1B5A5D2A2C3C4C5C5D1A4C3C3D1B5C1A2B2D4C3B4C2C4B5C3A3D2A1A3B5C3B2A2C3B4A2B4D2C1A2D3C4C5B5C4A4A1C1C2C4D3D2B1B3C3B5B4C3C4B5C4C2D4C1D1B3B4C3D2B5C3A4B3C2C3B5A5C3B1B3C3C1B2A3C3B2B5B4B2B5B2B1A3B5D3A1B2D4C1C3C1B2C4C2D4B1C3A5B2A1B4B5A1A5C2D1B4B2D1C3D2D5D3B5C4D1A5B2A3C2D2D1B3A5C1C2B2D1D5A5D4C2D3B1B5C3A2A2A3D2A3B4B4A3B4C3A3D4D3A1D5A1D1C4C3A4B3B2A5B5A2B1C2C2B4B1C4C2C2B2A4A2C5D5C5B3D1D4D5A3D1B1A4D1B1C4B5D4A1C3A5A2C3A4D4D1D4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C4D1C4D5A5C3D3B4D5D4D3A1C5D3A1A5C5B3B3C2C2C2D5D2A4D5A5C4A5B3C3B4A3A3B3B5D5D3D1D4B1C2B3D4C1B5C2A1A1D5C1B5D2A4D4A3D3B3D3D1C2B4B4D2B5D1A1A4B5B1D3C2D4A4B4B3B2B4C2D3C5D2B1A2D2B2B3D1D2D4D1C1D5C5C5B1A2A3D2C1D3D4B3B4B2C3C1C2B1A4D2C1C3D2B4C4D1D2B5C1A1A4A1B1C5C1D3A4C3C3D2D2C4A2C1A3 ...
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
Program 4~$AD FOR WHAT TO DO.docxProgram 4READ FOR WHAT TO.docx
1. Program 4/~$AD FOR WHAT TO DO.docx
Program 4/READ FOR WHAT TO DO.docx
Purpose
This program will provide an opportunity to solve a problem
related to two-dimensional arrays.
Specifications
You are required to summarize a very large set of voting data.
The data are contained in the file votingdata.txt
The format of the file includes one of the four candidates
(identified by code A, B, C, or D). The second item in each line
is an integer that identifies the voting precinct (1-5).
The objective is to count and summarize the vote in a report
something like the following. PRECINCT
1 2 3 4 5 TOTAL A xxx xxx xxx xxx xxx
xxxx B xxx xxx xxx xxx xxx xxxx C xxx xxx
xxx xxx xxx xxxx D xxx xxx xxx xxx xxx xxxx
TOTAL xxxx xxxx xxxx xxxx xxxx Candidate X is the
winner!
Utilize a two-dimensional array of counters to accumulate all of
the given fields of information and perform the required counts.
Use tons of comments!!!
Program
4/votingdata.txtA4B1B4C3A4A2C4C2B2B5C2D5B2C1B2C4B4
D4D2D4B5D5D3A2B4B1D2D2B4A2D4A2C2C1B5A1A3D1D4
C3B2B1D1C1B1B1A3B5C3B4B2D5C3D1B1A3A4B4A4D3A3C
2D5C3A2B5B4D2A1D5A2B4D3D5D1A1C2D5B1B2A1D5A1C4
B1D1C5B2C1C2A1D5D5C4D3B3A5C1D3D1B3A5C2A4B2D1A
1B4D4D1B1B5A5D2A2C3C4C5C5D1A4C3C3D1B5C1A2B2D4
C3B4C2C4B5C3A3D2A1A3B5C3B2A2C3B4A2B4D2C1A2D3C
4C5B5C4A4A1C1C2C4D3D2B1B3C3B5B4C3C4B5C4C2D4C1
D1B3B4C3D2B5C3A4B3C2C3B5A5C3B1B3C3C1B2A3C3B2B