Project #13422 - use the program C++ to solving

1.      In a container of candies there are 5 colors randomly placed: red, yellow, green, black  and blue. Assume that the container holds a maximum of 25 candies. Use a stack program to simulate randomly placing some (between 10 and 25 candies) initially into the container (stack). this is interactive

Now once that is done have the "user" choose a color and using ONLY stack functions remove all candies of that color. All candies in the container (stack) that are NOT of that color are returned to the candy in the same order they were in prior to the color removal. Actually loop the program twice to simulate "filling"   and "removing" two sets of candies. Don't assume that there are necessarily all colors of candy all the time...so for example someone might want all red candies but there might not be any red candies at that time.

Fill the container (or partially fill) only ONCE for each run. Here is an example:

 Suppose you place candies in this order:R R Y B G R B Y B G Y R BL B G 

Then the stack would look like this:

R

R

Y

B

G

R

          B

Y

B

G

Y

R

BL

B

G (top of stack)

If you asked to remove all green the resulting stack would be:

R

R

Y

B

R

B

Y

B

Y

R

BL

 

B(top of stack)

Subject Computer
Due By (Pacific Time) 10/02/2013 12:00 am
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy