Design a Java console application to conduct Elections. .

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.

 

Stressed over that homework?

Essay deadline breathing down your neck?

Let’s cut to the chase: Why struggle when you can ace it with zero hassle?

Whether it’s essays, research papers, or assignments — we’ve got you covered.

✅ Expert writers
✅ 100% original work
✅ No AI tools, just real pros

Stressed about your essay or homework? Get a top-quality custom essay NOW!!! Stop worrying. Start succeeding.

GradeEssays.com
We are GradeEssays.com, the best college essay writing service. We offer educational and research assistance to assist our customers in managing their academic work. At GradeEssays.com, we promise quality and 100% original essays written from scratch.
Contact Us

Enjoy 24/7 customer support for any queries or concerns you have.

Phone: +1 213 3772458

Email: support@gradeessays.com

© 2024 - GradeEssays.com. All rights reserved.

WE HAVE A GIFT FOR YOU!

15% OFF 🎁

Get 15% OFF on your order with us

Scroll to Top