subject

You may like the Pez candies and the wonderful dispensers that can be customized in so many ways. In each plastic container of Pez candy, the candies are of different colors, and they are stored in random order. Assume that you like the red candies only. Take a Pez dispenser, take out all candies one by one, eat the red ones, and put the others in a spare container you have at hand. Return the remaining candies in the initial container. Your Tasks:Create a class PezCandy in which you implement an array-based stackCreate a class PezCandyDriver in which you solve the problem as described aboveCreate an algorithm showing how you take out the candies, eat the red ones, and put them back in the container, in the original order. Place the algorithm, as a comment in the top of your PezCandyDriver fileUse an initial Pez dispenser with 12 candies, in which the colors of the candies are randomly chosen from: red, yellow, green, pink, blue. HintsRun the program and capture a snapshot showing the initial content of the Pez container, and the content after you ate all red candies. If you implement all the required methods properly, the driver program should generate outputs similar to the following:The original content of the Pez container Candy stack: pink red blue green blue red yellow blue yellow blue green red I am just eating a red candy I am just eating a red candy!!! The spare dispenser Candy stack: green blue yellow blue yellow blue green blue pink The content of Pez container after eating red candies Candy stack: pink blue green blue yellow blue yellow blue green Press any key to continue

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:40
Write c function that can replace all the positive elements to 0 and negative to 1 in undefined length one-dimensional array. test your program in the main program by defining one-dimensional array of 6 elements
Answers: 1
question
Computers and Technology, 22.06.2019 10:30
Dave has to create animations for a game. which tool can dave use?
Answers: 3
question
Computers and Technology, 22.06.2019 18:10
Assume that to_the_power_of is a function that expects two int parameters and returns the value of the first parameter raised to the power of the second parameter. write a statement that calls to_the_power_of to compute the value of cube_side raised to the power of 3 and that associates this value with cube_volume.
Answers: 1
question
Computers and Technology, 22.06.2019 19:00
In he example code, what does the title attribute create? a tool tip an element a source a markup
Answers: 1
You know the right answer?
You may like the Pez candies and the wonderful dispensers that can be customized in so many ways. In...
Questions
question
Mathematics, 05.05.2020 20:31
Questions on the website: 13722366