Design a Java console application to conduct Elections. . Define a class Candidatess with members for CanID, CanName and Votes. Define a class Voters class with VoterID, VoterName and age. Create a class called Election comprising of list of Candidates and list of Voters. Define a member function called Vote() to which a voter id and candidate id are passed as arguments. Verify whether the voter id is present in the Voters object array and the age is not less than 18. Then verify that the candidate id is present in the Candidates list. If so, increment the Votes member variable of the corresponding Candidate object in the list. Provide another method called declareResults in which count the no of votes recorded for each candidate and display the name of the candidate as the winner. In main, create an object for Election with 3 candidates and 10 voters. Assign some initial values for candidates and voters. Design a menu driven application with the following options. 1. Vote for candidate and 2. Declare Result. Handle the exceptions wherever needed.
Enjoy 24/7 customer support for any queries or concerns you have.
Phone: +1 213 3772458
Email: support@gradeessays.com