Question: Write a C++ program that will display a chain formed by drawing overlapping circles. Your program will perform the following steps: a. Prompt the user

Write a C++ program that will display a chain formed by drawing overlapping circles. Your program will perform the following steps:

a. Prompt the user for the radius, and desired rgb color for each circle. Also prompt the user for the number of circles to display. This is performed by the following prompts:

(Enter rgb color: 128 128 128

Enter radius: 20

Enter # of circles: 5)

These prompts should be implemented within the getData function whose prototype is shown below:

void getData(int* r, int* g, int* b, int* radius, int* no_circles)

Valid values for the radius is between 15 and 25 inclusively. Valid values for the number of circles is between 3 and 10 inclusively. This function is called in main as follows:

getData(&r, &g, &b,&radius, &no_circles);

b. Draw the first circle at coordinate (100,100). Each subsequent circle should overlap the previous one by 50%. Circles are numbered from 0,1, starting from the left. Every even numbered circle should be colored to the rgb color entered by the user in getData.

Use the following functions for implementing step b:

//Draws the overlapping circles - all white

//Returns an array containing the object number for each circle

int* drawChain( int radius, int no_circles);

//Colors the even chains to the desired color

//Uses the array containing the object numbers and the desired r/g/b //color

void colorChain(int* objects, int no_circles, int r, int g, int b);

(Functions Required)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!