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, 23.06.2019 15:00
To check whether your writing is clear , you can
Answers: 2
question
Computers and Technology, 23.06.2019 19:00
Now youÒ€ℒre on your own. include a short summary of this section with plots in your lab report. write a matlab script file to do steps (a) through (d) below. include a listing of the script file with your report. 1 the soundsc(xx,fs) function requires two arguments: the first one (xx) contains the vector of data to be played, the second argument (fs) is the sampling rate for playing the samples. in addition, soundsc(xx,fs) does automatic scaling and then calls sound(xx,fs) to actually play the signal. mcclellan, schafer, and yoder, dsp first, 2e, isbn 0-13-065562-7. prentice hall, upper saddle river, nj 07458. c 2015 pearson education, inc. 4 mcclellan, schafer and yoder, signal processing first. prentice hall, upper saddle river, new jersey, 2003. c 2003 prentice hall. (a) generate a time vector (tt) to cover a range of t that will exhibit approximately two cycles of the 4000 hz sinusoids defined in the next part, part (b). use a definition for tt similar to part 2.2(d). if we use t to denote the period of the sinusoids, define the starting time of the vector tt to be equal to t , and the ending time as ct . then the two cycles will include t d 0. finally, make sure that you have at least 25 samples per period of the sinusoidal wave. in other words, when you use the colon operator to define the time vector, make the increment small enough to generate 25 samples per period. (b) generate two 4000 hz sinusoids with arbitrary amplitude and time-shift. x1.t / d a1 cos.2
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
A. in packet tracer, only the server-pt device can act as a server. desktop or laptop pcs cannot act as a server. based on your studies so far, explain the client-server model.
Answers: 2
question
Computers and Technology, 24.06.2019 15:00
Universal windows platform is designed for which windows 10 version?
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, 12.07.2019 23:30
question
Mathematics, 12.07.2019 23:30
question
Mathematics, 12.07.2019 23:30
question
Geography, 12.07.2019 23:30
Questions on the website: 13722359