C++ CODING
₹100-400 INR / hour
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:
BL
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)
2. Write a program using stacks that tests whether or not a word, expression
or number is a palindrome. A palindrome is a word or expression that reads
the same forwards and backwards. (ignore punctuation and blanks) Test at
least 10 phrases and words. Be sure to label any palindromes as numeric
or string in the output. Make sure it works for more than just words
and you MUST use stacks! Also if a word is not a palindrome, see if the
program can make it one....example: “hello” is not a palindrome but
“hellolleh” is!
Examples of palindromes:
radar
Able was I ere I saw Elba
Madam I’m Adam
racecar
1991
2002
Project ID: #6578354
About the project
3 freelancers are bidding on average ₹318/hour for this job
Hello, I'm a French Engineer and I'm looking for interesting projects on Internet. I'm skilled in C/C++ programming. Hence, I will be able to help you. Regards, Franck