Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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;

}

image text in transcribed

Programming Exercise 21-1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions

Question

Identify the elements that make up the employee reward package.

Answered: 1 week ago

Question

Understand the purpose, value and drawbacks of the interview.

Answered: 1 week ago