Question: Redo the Election Results programming example of Chapter 18 so that it uses the STL class list to process candidates data. The program (in main.cpp)

Redo the Election Results programming example of Chapter 18 so that it uses the STL class list to process candidates data. The program (in main.cpp) should: Read data from candData.txt and voteData.txt Print out the number of votes each candidate received in each region Print the winners name and votes received in the following format: Winner: Sheila Bower, Votes Received: 493 Print the total number of votes in the following format: Total votes polled: 2216 An example of the program is shown below: --------------------Election Results-------------------- Votes Candidate Name Region1 Region2 Region3 Region4 Total ------------------ ------- ------- ------- ------- ------ Sheila Bower 23 70 133 267 493 Danny Dillion 25 71 156 97 349 Lisa Fisher 110 158 0 0 268 Greg Goldy 75 34 134 0 243 Peter Lamba 285 56 0 46 387 Mickey Miller 112 141 156 67 476 Winner: Sheila Bower, Votes Received: 493

out of 10.00

Election summary printed

Click the checkbox above to attempt this task.

Checks

Code PatternIncomplete

Did not hard code the program output

Test CaseIncomplete

Election data 1

0.00 out of 10.00

STL header file included

Click the checkbox above to attempt this task.

Checks

Code PatternIncomplete

Include list header file

0.00 out of 10.00

STL methods used

Click the checkbox above to attempt this task.

Checks

Code PatternIncomplete

Variable of type list declared

Code PatternIncomplete

Candidate list sorted with the sort method of the STL class list

Code PatternIncomplete

push_back used to add items to list variable

Code PatternIncomplete

iterator of type list declared to iterate through candidate list

main.cpp:

#include

using namespace std;

int main() {

// Write your main here

return 0;

}

Redo the Election Results programming example of Chapter 18 so that it

Programming Exercise 21-1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!