Question: we have discussed how we can design data structure in C to represent different objects such as playing cards. you are asked to design the

we have discussed how we can design data structure in C to represent different objects such as playing cards.

you are asked to design the appropriate data structure to represent geometric Circles. Each circle is represented by 3 paramenters:

x_coord: an integer representing the x coordinate of the center y_coord: an integer representing the y coordinate of the center radius: an integer representing the radius of the circle Once the data structure has been designed, please write the code (in your main function) to store the following circles:

c1 100, 100, 50

c2 200, 200, 30

c3 250, 150, 100

Write a function, name ShowCircumferences(), to calculate and print the circumferences (C = 2* Pi * Radius) of the three circles. Call this function at the bottom of your main() function and observer the output (This is the "BEFORE" observation)

Then add the following lines of code (at the very bottom of your main()) and run again :

c1->radius = c3->radius;

c2 = c1;

ShowCircumferences();

Now observer the new (i.e. "AFTER") output. Explain the why the AFTER is different from the BEFORE, and why it is the way it is?

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!