Question
You are to recursively draw circles as shown below. 1. User will give a radius as argument within the range of 10 50 and the
You are to recursively draw circles as shown below.
1. User will give a radius as argument within the range of 10 50 and the x and y coordinate that will become the center of the circle. Fix coordinates of the center point of the circle at x = 100 and y = 50.
2. Implement a function drawCircles that is recursive (calls itself)
3. The function must draw a circle of radius sent in parameter.
4. Must call itself with new radius that is half of the last circle drawn, in such a way that all circles touch the circumference of each other (like in the diagram below. HINT: keep y coordinate same for every call and change x coordinate by adding the (old_radius + new_radius) into it! ) and keep getting smaller until the radius becomes 1 and then it must stop.
HINT: Use library graphics.h for drawing
NOTE: The code should be in C Language with the exception of C++ libraries. Thanks.
ALSO: The software I use is " DEV C++ ".
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started