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 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 : Alex
Enter name of candidate : Benjamin
Enter name of candidate : Charlie
Enter name of candidate : David
Once the names are entered it will display the main menu:
To vote for Alex enter
To vote for Benjamin enter
To vote for Charlie enter
To vote for David enter
To close enter
Enter option:
When a is entered, the voting is closed and a report will be displayed:
The winner of the ballot is David with votes
Results Graph:
Alex
Benjamin
Charlie
David
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 builtin 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
