Question: Using Dev C + + . Design a class called Election that is used to manage a ballot. The program will manage a ballot between

Using Dev C++.
Design a class called Election that is used to manage a ballot. The program will manage a ballot between 3-5 candidates. The system initially will prompt the user to enter the number of candidates that is participate in the ballot system. Then, the system will request the names of the candidates.
For example:
Welcome to the ballot
Enter name of candidate 1: Alex
Enter name of candidate 2: Benjamin
Enter name of candidate 3: Charlie
Enter name of candidate 4: David
Once the names are entered it will display the main menu:
To vote for Alex enter 1
To vote for Benjamin enter 2
To vote for Charlie enter 3
To vote for David enter 4
To close enter 0
Enter option:
When a 0 is entered, the voting is closed and a report will be displayed:
The winner of the ballot is David with 9 votes
Results Graph:
Alex 3***
Benjamin 5*****
Charlie 4****
David 9*********
Implement common methods in the Election class such as constructor, destructor, getter, setter and other utility methods. Provide a way to store the data for the candidate names and vote counts.
You are not allowed to use the built-in collection objects such as vector or list and you must explain the logic for each implemented method clearly in your report.
Create a driver program to exercise the Election class.

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 Programming Questions!