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, 22.06.2019 01:00
Program description: a c# app is to be created to produce morse code. the morse code assigns a series of dots and dashes to each letter of the alphabet, each digit, and a few special characters (such as period, comma, colon, and semicolon). in sound-oriented systems, the dot represents a short sound and the dash represents a long sound. separation between words is indicated by a space, or, quite simply, the absence of a dot or dash. in a sound-oriented system, a space is indicated by a short period of time during which no sound is transmitted. the international version of the morse code is stored in the data file morse.txt.
Answers: 3
question
Computers and Technology, 23.06.2019 02:30
People with high self-esteem: accept their strengths and weaknesses. believe that failed experiences are failures of their whole self. feel good about who they are only when they reach total success. need positive external experiences to counteract negative feelings that constantly plague them.
Answers: 1
question
Computers and Technology, 23.06.2019 05:00
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most?
Answers: 2
question
Computers and Technology, 23.06.2019 06:20
Which text function capitalizes the first letter in a string of text? question 10 options: upper capital first proper
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.04.2021 15:10
question
Social Studies, 05.04.2021 15:10
question
Mathematics, 05.04.2021 15:20
Questions on the website: 13722367