Question
C++ Any circle is completely determined by its center (h, k) and radius r: (x-h)^2 + (y-k)^2 = r^2 Part I : 1. Define a
C++
Any circle is completely determined by its center (h, k) and radius r: (x-h)^2 + (y-k)^2 = r^2
Part I: 1. Define a structure that models the data needed to determine a circle and call it Circle. 2. Instantiate two Circle objects (no array) and allow the user to populate the data. 3. Create a METHOD that prints the circle. The cout in the method should string together a nice output. For example, sample output might look like (x-3)^2 + (y+2)^2 = 25 and (x+5)^2 + (y-4)^2 = 16 Run your program several times with different values for h, k and r. Be sure to account for any values for h, k and/or r that do not make sense. For example: r = -7 is not allowed. (In other words, perform some data validation here.)
Part II: 4. Write a method that returns the area. 5. Write a method that returns the circumference.
Demonstrate the usage of these methods in the main using the users input from above.
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