Write a program that randomly selects from a bag of eight objects. Each object c
ID: 3617849 • Letter: W
Question
Write a program that randomly selects from a bag of eight objects.
Each object can be red, blue, orange, or green and it can be a ball
or a cube. Assume the bag contains once object for
each combination, i.e. one red ball, one red cube, etc.
Using one character array for color and one for the shape, write a
program to draw random object from the bag with replacement.
Expected Output:
Enter no. of items to draw (0 to exit): 10
blue ball
orange ball
red ball
blue ball
red cube
red cube
green cube
green cube
red ball
blue ball
Enter no. of items to draw (0 to exit): 15
green ball
blue ball
blue cube
red ball
orange ball
green ball
orange cube
orange cube
blue ball
red ball
green cube
blue ball
green ball
orange ball
blue ball
Enter no. of items to draw (0 to exit): 2
red cube
blue cube
Enter no. of items to draw (0 to exit): 0