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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 07:30, DivineMemes420
What type of computer network ensures high security ?
Answers: 1
image
Computers and Technology, 23.06.2019 01:00, Ltik11900
Write the command that can be used to answer the following questions. (hint: try each out on the system to check your results.) a. find all files on the system that have the word test" as part of their filename. b. search the path variable for the pathname to the awk command. c. find all files in the /usr directory and subdirectories that are larger than 50 kilobytes in size. d. find all files in the /usr directory and subdirectories that are less than 70 kilobytes in size. e. find all files in the / directory and subdirectories that are symbolic links. f. find all files in the /var directory and subdirectories that were accessed less than 60 minutes ago. g. find all files in the /var directory and subdirectories that were accessed less than six days ago. h. find all files in the /home directory and subdirectories that are empty. i. find all files in the /etc directory and subdirectories that are owned by the group bin."
Answers: 1
image
Computers and Technology, 23.06.2019 10:30, tommyaberman
Would a ps4 wired controller work on an xbox one
Answers: 1
image
Computers and Technology, 23.06.2019 22:30, cuki96
Lakendra finished working on her monthly report. in looking it over, she saw that it had large blocks of white space. what steps could lakendra take to reduce the amount of white space?
Answers: 3
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 in other subjects:

Konu
Social Studies, 18.09.2020 15:01
Konu
Mathematics, 18.09.2020 15:01
Konu
Mathematics, 18.09.2020 15:01
Konu
History, 18.09.2020 15:01
Konu
Mathematics, 18.09.2020 15:01
Konu
Mathematics, 18.09.2020 15:01
Konu
Health, 18.09.2020 15:01
Konu
Health, 18.09.2020 15:01
Konu
Mathematics, 18.09.2020 15:01
Konu
Mathematics, 18.09.2020 15:01