Computers and Technology

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.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 03:00, Jadaflournoy5
Check my work the microprocessor is a(n) circuit, which is designed to process data based on a set of instructions. most desktop and laptop devices contain a microprocessor based on the standard. most tablets and smartphones contain processors based on technology. a microprocessor's circuitry is designed to perform a limited number of tasks contained in its set. during processing, an instruction is loaded into the processor's unit. data is loaded into registers in the processor's where arithmetic and logic operations are performed. microprocessor performance can be measured by its speed. other factors affecting overall processing performance include word size, cache size, and instruction set complexity. most digital devices contain only one microprocessor chip, but today's multi- processors contain circuitry that supports parallel processing. computers contain various kinds of memory. random memory is a special holding area for data, program instructions, and the system. it stores data on a temporary basis until the processor makes a data request. ram is different from disk storage because it is , which means that it can hold data only when the computer power is turned on. computers also contain read- memory, which is a type of non-volatile memory that provides a set of "hard-wired" instructions, called the loader, that a computer uses to boot up.
Answers: 3
image
Computers and Technology, 22.06.2019 14:30, chaparro0512
Create a pseudocode design to prompt a student for their student id and the titles of the three classes they want to add. the solution should display the student’s id and a total bill. • bill a student using the following rules: o students can only add up to 3 classes at a time.
Answers: 3
image
Computers and Technology, 23.06.2019 00:10, makailaaa2
My has been slow anyone else’s ?
Answers: 1
image
Computers and Technology, 23.06.2019 06:00, 573589
What machine listens for http requests to come in to a website’s domain? a. a router b. a browser c. a server d. a uniform resource locator
Answers: 1
Do you know the correct 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
Mathematics, 21.04.2020 16:51