subject

Hello - i have a java program with a class that i'm currently stuck on. i would appreciate any .
below is the pseudocode for my program:
constants:
block_size set to 3. this variable represents the size of an array and the size it increases by each time it is resized.
instance variables:
an array that stores candidates
an integer that stores the actual number of elements that are populated in the candidate array
an array that stores strings that represent each of the offices represented
an integer value that stores the actual number of elements that are populated in the offices array
methods:
constructor: set a default constructor that does the following:
instantiates the two arrays to block_size.
sets the two size variables to 0.
getters for the two sizes
tostring: this method should call the candidate tostring for each item in the array
hascandidate: this method accepts a candidate and using a for loop, searches the candidate array for the received candidate. if the candidate is found, return true. otherwise, return false.
iscandidatesfull: this method returns true if the size of the array matches the length of the array. otherwise, it returns false.
isofficefull: this method returns true if the size of the array matches the length of the array. otherwise, it returns false.
addcandidate(): this method will prompt and accept user input to get the information needed to create a candidate.
it will use the hascandidate method to ensure that a candidate is not on the list before being added to the list. if candidate is already on the list, return a message that reads, "candidate already on ballot."
if candidate is not on the list, then call the overloaded addcandidate method and pass in the candidate to be added.
addcandidate(candidate c): this private method accepts the candidate that will be added to the array.
first you must verify that the list is not full. if it is full, then you call the resizecandidate method.
create a new instance of candidate and add it to the candidates array.
determine whether this is a new office by searching the office array for a match. if no match (or array is empty), add the office to the office array, but you must first determine if the array is full, and if so, resize it.
addvotes: this method will prompt the user to enter votes for each candidate.
determinewinner: this method will display a list of offices that currently have candidates and the user will choose which office they want to determine winner for. it will build a menu of offices, from the offices array and display it to the user. it will call the method and will pass the users input to the method.
: this private method accepts user input and will build a temporary array that contains a list of all candidates that are running for the specific office the user has selected.
findhighestvotes: this private method receives the temporary array and the size of the array from method.
if there is only one candidate running for that office, then the candidate must have at least one vote to win.
if there is more than one candidate, then it will search the temp array for the most votes for that office. set the boolean won value for the winning candidate to true.
if the scores are equal, then there is no winner.
displaywinners: this method outputs all candidates who have won their race.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:30
Which of these options are the correct sequence of actions for content to be copied and pasted? select content, click the copy button, click the paste button, and move the insertion point to where the content needs to be inserted. click the copy button, select the content, move the insertion point to where the content needs to be inserted, and click the paste button. select the content, click the copy button, move the insertion point to where the content needs to be inserted, and click the paste button. select the content, move the insertion point to where the content needs to be inserted, click the copy button, and click the paste button.
Answers: 3
question
Computers and Technology, 23.06.2019 03:50
Q-1 which of the following can exist as cloud-based it resources? a. physical serverb. virtual serverc. software programd. network device
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
Amitha writes up a one-page summary of a novel during her summer internship at a publishing company. when she reads over the page, she realizes she used the word “foreshadow” seven times, and she would like to reduce the repetition. which tool would best amitha solve this problem?
Answers: 3
question
Computers and Technology, 24.06.2019 09:30
What is the definition of digital literacy?
Answers: 1
You know the right answer?
Hello - i have a java program with a class that i'm currently stuck on. i would appreciate any .
Questions
question
Mathematics, 15.04.2021 19:50
question
Mathematics, 15.04.2021 19:50
Questions on the website: 13722363