subject
Computers and Technology, 04.05.2021 18:40 mia3128

(The Queue class) Section 10.6 gives a class for Stack. Design a class named Queue for storing integers. Like a stack, a queue holds elements. In a stack, the elements are retrieved in a last-in
first-out fashion. In a queue, the elements are retrieved in a first-in first-out fashion. The
class contains:
â–  An int[] data field named elements that stores the int values in the queue.
â–  A data field named size that stores the number of elements in the queue.
â–  A constructor that creates a Queue object with default capacity 8.
â–  The method enqueue(int v) that adds v into the queue.
â–  The method de queue() that removes and returns the element from the queue.
â–  The method empty() that returns true if the queue is empty.
â–  The method getSize() that returns the size of the queue.
Draw an UML diagram for the class. Implement the class with the initial array size set to 8. The
array size will be doubled once the number of the elements exceeds the size. After an element is
removed from the beginning of the array, you need to shift all elements in the array one position
the left. Write a test program that adds 20 numbers from 1 to 20 into the queue and removes these
numbers and displays them.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 07:00
Why were most movies from the late 1890s until the early 1930s only filmed in black and white? there were only a few people who could afford the technology to produce color motion pictures back then. audiences did not want color motion pictures until later. the film used to make color motion pictures often overheated, which was a safety hazard, so it was generally not allowed. color films had to be hand-colored, frame by frame.
Answers: 3
question
Computers and Technology, 23.06.2019 09:30
:you areto design the controller for alight that functions both as an ordinary light and also as a motion activated light and alarm. a.if the manual switch s is on, then the light l is on. b.besides the manual switch, there is a motion detector, m1, which activatesthis light.c.if motion is detected but the light is on anyway because s is on, only then a secondoutput a, an alarm, is turned on. d.the disable switch, d, disables the motion activated light and alarmbut leaves manual control operation of the light using switch s.(i)read the problem statement and clearly identify the inputs and outputs for the circuit you are designing. (ii)create the truth table for this system; include the light, alarm, switch, disable, and the motion sensor.(iii)draw a schematic of this system.
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest value. you may assume there is at least one value. (cascading/streaming logic, basic string processing)
Answers: 3
question
Computers and Technology, 24.06.2019 08:30
Intellectual property rights are exclusive rights that protect both the created and the creation. ipr offers exclusively what benefits to the person or people covered by it
Answers: 3
You know the right answer?
(The Queue class) Section 10.6 gives a class for Stack. Design a class named Queue for storing int...
Questions
question
Mathematics, 30.06.2019 08:00
question
Mathematics, 30.06.2019 08:00
question
Mathematics, 30.06.2019 08:00
Questions on the website: 13722360