Question: In Java / * * * Adds 1 vote to the provided Candidate running in the election for the given seatName, if this * Ballot
In Java
Adds vote to the provided Candidate running in the election for the given seatName, if this
Ballot has not yet voted in that election. Marks the election as having been voted in if the
vote is successful.
You may wish to create a private helper method to find the index of a particular election in
the elections ArrayList given its seat name, or explore options ArrayList provides.
@param seatName the name of the seat for the election to vote in
@param candidate the Candidate to vote for
Throws:
IllegalStateException if this ballot has already voted in the given election
NoSuchElementException if the given seat name does not correspond to an election on this
ballot, or if the given candidate is not running in that election
public void voteString seatName, Candidate candidate
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
