Electrical and Computer Engineering
3 of 19
UAH
CPE 112
Problem-Solving Case Study –
City Council Election
•More Discussion: A table is easily represented by a two-dimensional array. We can save the names of the candidates in a one-dimensional array. The book example uses precincts for row headings and candidate numbers for column headings.
•Data Structures: A two-dimensional array names votes, where the rows represent precincts and the columns represent candidates. A one-dimensional array of strings containing the names of the candidates.