Electrical and Computer Engineering
17 of 19
UAH
CPE 112
Implementation
•        // Compute column sum
•
•        for (precinct = 0; precinct < NUM_PRECINCTS; precinct++)
•            total = total + votes[precinct][candidate];
•
•        reportFile << "Total votes for"
•                   << setw(10) << name[candidate] << ":"
•                   << setw(3) << total << endl;
•    }
•    reportFile << endl;
•}